Jump to content


Photo

Scripting Issue


  • Please log in to reply
8 replies to this topic

#1 Pasidon

Pasidon

    Splitting Hares

  • Network Admins
  • 9,126 posts
  • Location:Indiana
  • Projects:Writing Words With Letters
  •  I Help
  • Division:Community
  • Job:Community Admin

Posted 24 April 2015 - 02:42 AM

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?



#2 Fudge

Fudge

    title available

  • Project Team
  • 531 posts
  • Location:Devon, England
  • Projects:Luckily AotR Mapping

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 Pasidon

Pasidon

    Splitting Hares

  • Network Admins
  • 9,126 posts
  • Location:Indiana
  • Projects:Writing Words With Letters
  •  I Help
  • Division:Community
  • Job:Community Admin

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 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

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...


Ridder Geel

#5 Pasidon

Pasidon

    Splitting Hares

  • Network Admins
  • 9,126 posts
  • Location:Indiana
  • Projects:Writing Words With Letters
  •  I Help
  • Division:Community
  • Job:Community Admin

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 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

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'.


2qm3dd5.jpg


#7 Elric

Elric

    Designer

  • Hosted
  • 2,857 posts
  • Projects:Middle-Earth Expanded
  •  Coder
  • Donated

Posted 26 April 2015 - 12:38 PM

Pas, this is what I was trying to do with the flags but you said you had something work Soo no idea how hahah

#8 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 27 April 2015 - 04:19 PM

@Elric You mean how i created for example Upgrade_CaveTroll?


2qm3dd5.jpg


#9 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 25 May 2015 - 05:13 AM

Since it seems like nobody experienced this before, I'm going to think to make it work by a different way - so the WB will fire a weapon over that place where the units spawn


2qm3dd5.jpg





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users