HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Destructables created after map init are not spawning items

01-04-2004, 07:53 PM#1
Imbrifer
Yes, long title. Anyhow, I have it set up so that when a certain type of destructable is destroyed, between 1 and 3 items are created in its place. This works fine for destructables placed in the editor, but ones added with triggers do not spawn items when destroyed. Here is the item destruction trigger. The trigger that creates new destructables just does that - creates a destructable in Dropzone0.

Container Destruction0
Events
Destructible - A destructible within Dropzone0 <gen> dies
Conditions
((Destructible-type of (Dying destructible)) Equal to Steel Barrel) or ((Destructible-type of (Dying destructible)) Equal to Steel Crates)
Actions
Set BrokenContainer = (Dying destructible)
Set IntRandItemNum = (Random integer number between 1 and 3)
If (IntRandItemNum Equal to 1) then do (Trigger - Run Item Spawn <gen> (checking conditions)) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
IntRandItemNum Equal to 2
Then - Actions
Trigger - Run Item Spawn <gen> (checking conditions)
Trigger - Run Item Spawn <gen> (checking conditions)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
IntRandItemNum Equal to 3
Then - Actions
Trigger - Run Item Spawn <gen> (checking conditions)
Trigger - Run Item Spawn <gen> (checking conditions)
Trigger - Run Item Spawn <gen> (checking conditions)
Else - Actions


P.S. - the 'Item Spawn' trigger just has actions that say 'if random number = x, create item', 'if random number = y, create different item', etc.

And here is the second trigger, which spawns the destructables after map initialization...

MorningDrop
Events
Game - The in-game time of day becomes Equal to 6.00
Conditions
IntLitBeacons Equal to 4
Actions
Set IntRandDrop = (Random integer number between 1 and 10)
If (IntRandDrop Equal to 1) then do (Destructible - Create a Steel Crates at (Random point in Dropzone0 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 2) then do (Destructible - Create a Steel Crates at (Random point in Dropzone1 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 3) then do (Destructible - Create a Steel Crates at (Random point in Dropzone2 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 4) then do (Destructible - Create a Steel Crates at (Random point in Dropzone3 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 5) then do (Destructible - Create a Steel Crates at (Random point in Dropzone4 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 6) then do (Destructible - Create a Steel Crates at (Random point in Dropzone5 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 7) then do (Destructible - Create a Steel Crates at (Random point in Dropzone6 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 8) then do (Destructible - Create a Steel Crates at (Random point in Dropzone7 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 9) then do (Destructible - Create a Steel Crates at (Random point in Dropzone8 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
If (IntRandDrop Equal to 10) then do (Destructible - Create a Steel Crates at (Random point in Dropzone9 <gen>) facing (Random angle) with scale 1.00 and variation 0) else do (Do nothing)
Game - Display to (All players) the text: Supplies have been ...
Wait 2.00 seconds
Cinematic - Ping minimap for (All players) at (Position of (Last created destructible)) for 4.00 seconds
01-04-2004, 10:31 PM#2
Vexorian
Use Trigger - Add Event to add a (last created destructible dies) event to that trigger (just after you create a destructible)
01-05-2004, 12:01 AM#3
Imbrifer
I love you, Vex. Thank you SO much!