Hello... yes... it's me. I have an issue that makes no sense. I'm trying to make a script that continuously spawns units. It works, as the named unit spawns on the waypoint and such, based on a timer. But when I tell the timer's script to not "deactivate upon success" so it keeps spawning new units, the unit dos not spawn at all. Is there some sort of issue with the "deactivate upon success" option, or something stupid?
Scripting Issue
#1
Posted 24 April 2015 - 02:42 AM
#2
Posted 24 April 2015 - 06:11 AM
I don't know if its possible to spawn duplicates of named units, it might work better by setting up a team and spawning an instance of that instead. Ensure the 'maximum number' in the upper right corner of the team behaviours is set to some high number, as I thick this feature dictates (if I remember correctly) the maximum number of times this team can be created/spawned.
Is the script set to evaluate 'every frame' 'or every x seconds?'
#3
Posted 24 April 2015 - 06:56 AM
Oh yea... I didn't think about the units being the same name being an issue. Then again, I would at least expect it to spawn 1. And I'm rust bucket'ting on setting up teams, so I'll need to experiment with... all that.
And I have it per frame.
#4
Posted 24 April 2015 - 07:22 AM
Sometimes it also depends on what 'player' executes the script...
To be honest WB scripting usually ends up being trial and error and all that...
#5
Posted 24 April 2015 - 06:29 PM
It usually ends up with me giving up and complaining to someone (like this), but I'll try and trial it some more later today. I'll be back with more errors.
#6
Posted 26 April 2015 - 07:17 AM
I have a "similar" problem regarding WB scripts...... I have made in the map.ini a whole set of upgrades, wich can be purchased from a building.... once you bought one, some scripts make a certain flag TRUE, then based on the flag TRUE another script evaluates each 25s (or different on other upgrades) and spawns a team of units ( its a ringwars map). The spawning should be endless as long as the player is not defeated and this works okay, however after the player is defeated it still spawns neutral units wich stand there and create a huge lag ( especially when he bought mumakils wich have lots of poly's). I have created scripts to deactive the flags but they don't seem to have any effect.
*** IF *** Team 'Player_1/teamPlayer_1' has been destroyed. *** THEN *** Set Flag named 'Attack Troll' to FALSE Set Flag named 'Axe Thrower' to FALSE Set Flag named 'Ballista' to FALSE Set Flag named 'BattleWagon' to FALSE Set Flag named 'CaveTroll' to FALSE Set Flag named 'Corsair' to FALSE Set Flag named 'Demolisher' to FALSE Set Flag named 'Drummer Troll' to FALSE Set Flag named 'DunedainRanger' to FALSE Set Flag named 'Easterling' to FALSE Set Flag named 'FireDrake' to FALSE Set Flag named 'GoblinWarrior' to FALSE Set Flag named 'GondorArcher' to FALSE Set Flag named 'GondorKnight' to FALSE Set Flag named 'GondorSoldier' to FALSE Set Flag named 'GondorTowerGuard' to FALSE Set Flag named 'Guardian' to FALSE Set Flag named 'LorienArcher' to FALSE Set Flag named 'LorienFighter' to FALSE Set Flag named 'MirkwoodArcher' to FALSE Set Flag named 'MithlondSentry' to FALSE Set Flag named 'Mumakil' to FALSE Set Flag named 'OrcArcher' to FALSE Set Flag named 'OrcFighter' to FALSE Set Flag named 'Phalanx' to FALSE Set Flag named 'Spiderrider' to FALSE Set Flag named 'Trebuchet' to FALSE Set Flag named 'UrukCrossbow' to FALSE Set Flag named 'UrukHai' to FALSE Set Flag named 'UrukPike' to FALSE Set Flag named 'WargRider' to FALSE Set Flag named 'Wildmen' to FALSE
here is another one wich should deactivate the spawning units folder...
*** IF *** Player 'Player_1' has lost an object of type 'DwarvenFortress' (can be an object type list). *** OR *** Player 'Player_1' has lost an object of type 'ElvenFortress' (can be an object type list). *** OR *** Player 'Player_1' has lost an object of type 'IsengardFortress' (can be an object type list). *** OR *** Player 'Player_1' has lost an object of type 'MenFortress' (can be an object type list). *** OR *** Player 'Player_1' has lost an object of type 'MordorFortress' (can be an object type list). *** OR *** Player 'Player_1' has lost an object of type 'WildFortress' (can be an object type list). *** THEN *** All of Player 'Player_1''s buildings and units are dealt a lethal amount of damage. Disable Script 'player 1 spawns'.
how the upgrade thing works actually...
*** IF *** Player Player 'Player_1' built Upgrade 'Upgrade_CaveTroll'. *** THEN *** Set Flag named 'CaveTroll' to TRUE ;--------------------------------------------------------- *** IF *** Flag named 'CaveTroll' IS TRUE *** THEN *** Spawn an instance of Team 'Player_1/Wild Cave Troll' at Waypoint 'Spawn_army_1'.
#7
Posted 26 April 2015 - 12:38 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users