Staredit Network

Staredit Network -> UMS Assistance -> Drops
Report, edit, etc...Posted by SaGa on 2005-06-07 at 17:17:05
I'm making a map where when u kill a unit it could drop soemthing. I was thinking like a 75% chance it wont and 25% chance u will get a drop. The drops could range from ammo to a new gun. The problem is since you can't center a location to create a ammo box or whatever on a dead unit so how would i make the drop happen in the place the unit died? i tried to center a location on a unit inside the vis of the players unit. When the unit died it flipped a switch when in turn flipped a death count. The problem was that the box was created where my guy stood not the marine I was shooting at.

If anyone would help i could use it. smile.gif
Report, edit, etc...Posted by KiLLeR2001 on 2005-06-07 at 18:01:12
Well for the 'chance' of a dead unit dropping something you just simply need to randomize 2 switches.

For the centering location on dead unit you can do a trigger that only centers on the unit when a player 'commands' that unit. So when the player dies, the location will stop centering and will stay where the dead unit was until you tell it to move otherwise.
Report, edit, etc...Posted by LethaL on 2005-06-07 at 19:44:46
Instead of using a visual drop (Making an item actually appear there) you can do a text/death-based drop (Tell the person what dropped, and add a death count to that item showing that they received one).

Randomize two switches (S = Set, C = Cleared)
S 1, S 2
S 1, C 2
C 1, S 2
C 1, C 2

for a 75% of nothing and a 25% change of something dropping, make just one of these have a dropping action. You could use switches:
If C 1, C 2 was the combination that triggered a drop, randomize switch x (x decides which item drops. If you want 2 items to drop, randomize 1 switch. 4 items, 2 switches, and so on [x² = y, where x is the number of switches and y is the number of items you want dropped]). Then with the switches as conditions, make the actions the text saying the item dropped and the death counters being the item itself.

Trigger
Conditions:
¤ Current Player Kills at least 1 Zergling
Actions:
¤ Modify Score for Current Player: Set Kills to 0 for Zergling
¤ Randomize Switch 'Drop1'
¤ Randomize Switch 'Drop 2'
¤ Preserve Trigger


Trigger
Conditions:
¤ 'Drop 1' is Cleared
¤ 'Drop 2' is Cleared
Actions:
¤ Randomize 'Item 1'
¤ Randomize 'Item 2'
¤ Preserve Trigger

The above trigger is for the 25% chance an item drops. for the other 75% chance of something NOT dropping, use this one:
Trigger
Conditions:
¤ 'Drop 1' is Set
¤ 'Drop 2' is Set
Actions:
¤ (Optional) Display Text Message: "No item was dropped."
¤ Preserve Trigger


Now for the actual item randomization:
Trigger
Conditions:
¤ 'Item 1' is Set
¤ 'Item 2' is Set
Actions:
¤ Display Text Message: "Found 1 Healing Potion"
¤ Modify deaths for Current Player: Add 1 for 'Healing Potion'
¤ Preserve Trigger

Now instead of 'Item 1' is Set and 'Item 2' is Set, you can have either of them cleared and use another trigger for a different item being dropped.

Sorry if this is confusing. If you still don't understand (And nobody else helps) PM me and I will try to make a sample map.
Report, edit, etc...Posted by (U)Bolt_Head on 2005-06-08 at 08:29:47
What on earth? Thats a weird way of randomizing. And your math isn't exacly correct

what you showed is 1/4 chance of special nothing and 1/8th chance of healing potion. and 5/8ths chance of untriggered nothing.

Also this excludes that fact that your first trigger runs all the time until the first random event picks something other than clear. (switches start off clear)
Report, edit, etc...Posted by LethaL on 2005-06-08 at 17:50:29
blushing.gif Yea, I forgot the switch in the first trigger to allow them to run at the right time instead of always.

Apparently I'm not very good at explaining, but I can do the triggers right in the editor if I needed them.
Report, edit, etc...Posted by PCFredZ on 2005-06-08 at 20:08:07
QUOTE
¤ Modify Score for Current Player: Set Kills to 0 for Zergling

There's no such thing... -.-
Next Page (1)