HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

help! conditions not working ???

07-11-2007, 08:42 PM#1
fps-doug
Hello everyone, I;m sorry to just throw a big trigger in your face, but Ive been working on this problem for hours and Im completely stumped. In my map you can place bombs, and they are given an expiration timer of 3 secs. This is the trigger that fires when a bomb expires (and of course dies). It creates a blast to the north south east and west of where the bomb originally sat.

I have a coordinate system on my map. each bomb is placed on a coordinate. the way i numbered my grid is like this:


19 20 21 22 23 24 25 26 27
10 11 12 13 14 15 16 17 18
1 2 3 4 5 6 7 8 9



as you can see the numbering starts from the bottom left. This isnt my actual grid, its just a smaller representation (the real grid is 13 wide, 11 high).

So in my example grid, say a bomb was placed on the left side of the grid. It would be in either slot 1, 10, or 19. If it was on the top side, it would be 19, 20, 21, ... or 27. In my trigger, I have conditions set up so that if the bomb is on a certain spot, no blast goes off in that direction (because thats already at the edge). The way I reference what spot the bomb is in is I set the custom value of the bomb to the number spot its in. I use custom value because this is the 2nd trigger of my bomb system (the first one deals with setting the bomb) and each player can set many bombs, so using global variables I think its long tedious and inefficient. Also I already used a local variable for the bomb..

So my problem in the trigger is even though I have conditions that will refuse to create explosions in a certain direction based on whether or not the bomb is on one of the border numbers of the grid, an explosion still goes off in that direction. Ive looked and stared at it many times and I dont see whats wrong in my trigger. I have debug messages and the debug correctly displays the grid number that the bomb is in. it even reads off the custom value AFTER the conditional passes, and the custom value comes up as one of the numbers that should not have gone through!!


here is my trigger below... sorry for this all being so long, but I would greatly appreciate if anyone can help me figure out why the conditions are passing correctly.. like I said before the debug messages are displaying the correct number when I place a bomb on the border of the grid, but still there are explosions in all 4 directions.........

Trigger:
Exploding Bomb
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Dying unit)) Equal to Bomb (RUN) lol
Collapse Actions
Custom script: local unit udg_Local_Bomb
Set Local_Bomb = (Dying unit)
Game - Display to (All players) the text: BOOM
Set bombs_live[(Player number of (Owner of Local_Bomb))] = (bombs_live[(Player number of (Owner of Local_Bomb))] - 1)
Set square_blocked[(Custom value of Local_Bomb)] = 0
Special Effect - Create a special effect at (Center of movespaces_array[(Custom value of Local_Bomb)]) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Trigger - Run Destroy effects <gen> (ignoring conditions)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Custom value of Local_Bomb) Equal to 1
(Custom value of Local_Bomb) Equal to 14
(Custom value of Local_Bomb) Equal to 27
(Custom value of Local_Bomb) Equal to 40
(Custom value of Local_Bomb) Equal to 53
(Custom value of Local_Bomb) Equal to 66
(Custom value of Local_Bomb) Equal to 79
(Custom value of Local_Bomb) Equal to 92
(Custom value of Local_Bomb) Equal to 105
(Custom value of Local_Bomb) Equal to 118
(Custom value of Local_Bomb) Equal to 131
Collapse Then - Actions
Game - Display to (All players) the text: NO GO
-------- then dont make explosion here, were on the left side of the map --------
Collapse Else - Actions
Collapse For each (Integer A) from 1 to bomb_boom_radius[(Player number of (Owner of Local_Bomb))], do (Actions)
Collapse Loop - Actions
Game - Display to (All players) the text: (custom value = + (String((Custom value of Local_Bomb))))
Game - Display to (All players) the text: (left explosion + (String((Integer A))))
Special Effect - Create a special effect at (Center of movespaces_array[((Custom value of Local_Bomb) - (Integer A))]) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Trigger - Run Destroy effects <gen> (ignoring conditions)
Collapse Unit Group - Pick every unit in (Units in movespaces_array[((Custom value of Local_Bomb) - (Integer A))]) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to block
Collapse Then - Actions
Set square_blocked[((Custom value of Local_Bomb) - (Integer A))] = 0
Else - Actions
Unit - Kill (Picked unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Custom value of Local_Bomb) Equal to 13
(Custom value of Local_Bomb) Equal to 26
(Custom value of Local_Bomb) Equal to 39
(Custom value of Local_Bomb) Equal to 52
(Custom value of Local_Bomb) Equal to 65
(Custom value of Local_Bomb) Equal to 78
(Custom value of Local_Bomb) Equal to 91
(Custom value of Local_Bomb) Equal to 104
(Custom value of Local_Bomb) Equal to 117
(Custom value of Local_Bomb) Equal to 130
(Custom value of Local_Bomb) Equal to 143
Collapse Then - Actions
Game - Display to (All players) the text: NO GO
-------- then dont make explosion here, were on the right side of the map --------
Collapse Else - Actions
Collapse For each (Integer A) from 1 to bomb_boom_radius[(Player number of (Owner of Local_Bomb))], do (Actions)
Collapse Loop - Actions
Game - Display to (All players) the text: (custom value = + (String((Custom value of Local_Bomb))))
Game - Display to (All players) the text: (right explosion + (String((Integer A))))
Special Effect - Create a special effect at (Center of movespaces_array[((Custom value of Local_Bomb) + (Integer A))]) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Trigger - Run Destroy effects <gen> (ignoring conditions)
Collapse Unit Group - Pick every unit in (Units in movespaces_array[((Custom value of Local_Bomb) + (Integer A))]) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to block
Collapse Then - Actions
Set square_blocked[((Custom value of Local_Bomb) + (Integer A))] = 0
Else - Actions
Unit - Kill (Picked unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of Local_Bomb) Not equal to 131
(Custom value of Local_Bomb) Not equal to 132
(Custom value of Local_Bomb) Not equal to 133
(Custom value of Local_Bomb) Not equal to 134
(Custom value of Local_Bomb) Not equal to 135
(Custom value of Local_Bomb) Not equal to 136
(Custom value of Local_Bomb) Not equal to 137
(Custom value of Local_Bomb) Not equal to 138
(Custom value of Local_Bomb) Not equal to 139
(Custom value of Local_Bomb) Not equal to 140
(Custom value of Local_Bomb) Not equal to 141
(Custom value of Local_Bomb) Not equal to 142
(Custom value of Local_Bomb) Not equal to 143
Collapse Then - Actions
Game - Display to (All players) the text: (custom value = + (String((Custom value of Local_Bomb))))
Collapse For each (Integer A) from 1 to bomb_boom_radius[(Player number of (Owner of Local_Bomb))], do (Actions)
Collapse Loop - Actions
Game - Display to (All players) the text: (up explosion + (String((Integer A))))
Special Effect - Create a special effect at (Center of movespaces_array[((Custom value of Local_Bomb) + (13 x (Integer A)))]) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Trigger - Run Destroy effects <gen> (ignoring conditions)
Collapse Unit Group - Pick every unit in (Units in movespaces_array[((Custom value of Local_Bomb) + (13 x (Integer A)))]) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to block
Collapse Then - Actions
Set square_blocked[((Custom value of Local_Bomb) + (13 x (Integer A)))] = 0
Else - Actions
Unit - Kill (Picked unit)
Collapse Else - Actions
-------- then dont make explosion here, were on the top side of the map --------
Game - Display to (All players) the text: NO GO
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Custom value of Local_Bomb) Equal to 1
(Custom value of Local_Bomb) Equal to 2
(Custom value of Local_Bomb) Equal to 3
(Custom value of Local_Bomb) Equal to 4
(Custom value of Local_Bomb) Equal to 5
(Custom value of Local_Bomb) Equal to 6
(Custom value of Local_Bomb) Equal to 7
(Custom value of Local_Bomb) Equal to 8
(Custom value of Local_Bomb) Equal to 9
(Custom value of Local_Bomb) Equal to 10
(Custom value of Local_Bomb) Equal to 11
(Custom value of Local_Bomb) Equal to 12
(Custom value of Local_Bomb) Equal to 13
Collapse Then - Actions
Game - Display to (All players) the text: NO GO
-------- then dont make explosion here, were on the bottom side of the map --------
Collapse Else - Actions
Collapse For each (Integer A) from 1 to bomb_boom_radius[(Player number of (Owner of Local_Bomb))], do (Actions)
Collapse Loop - Actions
Game - Display to (All players) the text: (custom value = + (String((Custom value of Local_Bomb))))
Game - Display to (All players) the text: (down explosion + (String((Integer A))))
Special Effect - Create a special effect at (Center of movespaces_array[((Custom value of Local_Bomb) - (13 x (Integer A)))]) using Objects\Spawnmodels\Human\FragmentationShards\FragBoomSpawn.mdl
Trigger - Run Destroy effects <gen> (ignoring conditions)
Collapse Unit Group - Pick every unit in (Units in movespaces_array[((Custom value of Local_Bomb) - (13 x (Integer A)))]) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to block
Collapse Then - Actions
Set square_blocked[((Custom value of Local_Bomb) - (13 x (Integer A)))] = 0
Else - Actions
Unit - Kill (Picked unit)
Unit - Explode Local_Bomb
07-11-2007, 08:57 PM#2
maximilianx
cooool a bomberman map!

well, how about trying a completely different aproach, (i didn't really examine your trigger with detail)

you could make the borders of the map rects instead, and use a condition that checks if the unit is in a specific rect..

maybe?
07-11-2007, 09:04 PM#3
fps-doug
ok, I guess ill try putting rects that cover the border grid points.. then ill detect if the bomb is in the rects or not. ill be back..
07-11-2007, 09:23 PM#4
fps-doug
OK I really dont understand whats going wrong.......


I tried the rect thing you suggested. Here's the part of the trigger thats giving my problems...

Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(border left <gen> contains Local_Bomb) Equal to True
Collapse Then - Actions
Game - Display to (All players) the text: NO GO
-------- then dont make explosion here, were on the left side of the map --------
Collapse Else - Actions
Collapse For each (Integer A) from 1 to bomb_boom_radius[(Player number of (Owner of Local_Bomb))], do (Actions)
Collapse Loop - Actions
Game - Display to (All players) the text: (custom value = + (String((Custom value of Local_Bomb))))
Game - Display to (All players) the text: (left explosion + (String((Integer A))))
Special Effect - Create a special effect at (Center of movespaces_array[((Custom value of Local_Bomb) - (Integer A))]) usi blah blah blah blah
Trigger - Run Destroy effects <gen> (ignoring conditions)


If it worked right, all I would see is NO GO, but instead I get all the output from the custom values, etc.I placed the rects on the borders like you suggested, and I placed a bomb smack dab in one of those borders. I even spawned a thunderclap effect right where the bomb is, (using Local_Bomb) right before the part that I pasted, and the thunderclap lands smack in the middle of the rect... but for SOME REASON its just not working! I really have no idea whats wrong.. the Local_Bomb is made a local variable by custom script at the top of the actions... so there should be no interference from outside forces, but I really cant figure out what is wrong..... im open to all suggestions..
07-12-2007, 12:56 AM#5
TheSecretArts
check your regions... put lots of debug messeges, like Game - Display text to all players the text: Bomberman is at <Get Unit X>,<Get Unit Y>
07-12-2007, 02:40 AM#6
fps-doug
well ive solved the problem apparently so far.. what ive ended up doing is spawning dummy units to the -256 X, +256 X, 256 Y and -256 Y, and then checking to see if said dummy was in a certain region (the regions that max suggested)... so yea................ it seems I have worked around this problem, so thanks for your help you two.