| 06-18-2004, 12:31 AM | #1 |
Hey guys, I'm having some trouble, i'm making a td and my spawn system have worked neatly until recently when i decided to add Bosses at different levels and so on. What's going wrong is this: The map REFUSES to run level two, all others work fine. It displays incorrect messages for amount of bosses and doesn't spawn the bosses at all. I've got this piece of code: Actions -------- -------LEVEL 1--------- -------- Set Monsters_Type[P1] = Swordsman Level1 Set Monster_amount[P1] = 10 Set Name_of_Level[P1] = (Units in Level 01 <gen>) Set Name_of_Bosslevel[P1] = (Units in BossLevel 01 <gen>) Set P1 = (P1 + 1) -------- -------LEVEL 2--------- -------- Set Monsters_Type[P1] = ForestSpider Level2 Set Monster_amount[P1] = 8 Set Name_of_Level[P1] = (Units in Level 02 <gen>) Set Name_of_Bosslevel[P1] = (Units in BossLevel 02 <gen>) Set P1 = (P1 + 1) -------- -------LEVEL 3--------- -------- Set Monsters_Type[P1] = Seal Level3 Set Monster_amount[P1] = 6 Set Boss_type[P1] = Sheep Level4 Set Boss_amount[P1] = 3 Set Name_of_Level[P1] = (Units in Level 03 <gen>) Set Name_of_Bosslevel[P1] = (Units in BossLevel 03 <gen>) Set P1 = (P1 + 1) -------- -------LEVEL 4--------- -------- Set Monsters_Type[P1] = Sheep Level4 Set Monster_amount[P1] = 7 Set Name_of_Level[P1] = (Units in Level 04 <gen>) Set Name_of_Bosslevel[P1] = (Units in BossLevel 04 <gen>) Set P1 = (P1 + 1) That's the "set up" for the levels, dunno if i did it wrong there. Here is the Spawn Trigger (with some shit cut out) Code:
Actions
Custom script: local location udg_temppoint
Set PlayerCurrentLevel[1] = Current_Level_p1
For each (Integer A) from 1 to Monster_amount[Current_Level_p1], do (Actions)
Loop - Actions
Set temppoint = (Random point in Regions[1])
Unit - Create 1 Monsters_Type[Current_Level_p1] for (Triggering player) at temppoint facing Default building facing (270.0) degrees
Custom script: call RemoveLocation ( udg_temppoint )
For each (Integer A) from 1 to Boss_amount[Current_Level_p1], do (Actions)
Loop - Actions
Set temppoint = (Random point in Regions[1])
Unit - Create 1 Boss_type[Current_Level_p1] for (Triggering player) at temppoint facing Default building facing (270.0) degrees
Custom script: call RemoveLocation ( udg_temppoint )
Game - Display to Player Group - Player 1 (Red) the text: (((Level - + (String(Current_Level_p1))) + : ) + ((String(Monster_amount[Current_Level_p1])) + ( + (((Name of (Random unit from Name_of_Level[Current_Level_p1])) + and ) + ((String(Boss_amount[Current_Level_p1])) + ( + (((Name of (Random unit from Name_of
Set temppoint = (Random point in Regions[9])
Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Unit - Order (Picked unit) to Move To (Random point in Regions[(Player number of (Triggering player))]))
Custom script: call RemoveLocation ( udg_temppoint )
Set Current_Level_p1 = (Current_Level_p1 + 1)If you have another soultion or find whats wrong, please answer, I've been debugging this one 4 too long. |
| 06-18-2004, 01:39 AM | #2 |
It looks fine to me, don't notice anything wrong... |
| 06-18-2004, 03:32 AM | #3 |
I didnt notice anything, but its hard to tell without a map. i do have a suggestion however. Try adding debug messages to the trigger, things like, entered boss loop, and printing the variable names. This is one of those things they teach you in programming classes and it really does help. |
| 06-18-2004, 03:44 PM | #4 |
Well, i didn't see anything either but I'll try what you said with the Debug messages. |
