Staredit Network

Staredit Network -> UMS Assistance -> [SOLVED] Random Item Spawn
Report, edit, etc...Posted by FizzleBoink on 2006-07-31 at 11:20:20
Okay! I'm not too good with randomizing item spawns and have come to ask for aid in the development of the triggers. My dilemma is that I have six items and would like for each one of them to spawn at different times, however I would like some items to appear less frequently than a few others. As you might have guessed, I have no idea how to do this and how to properly randomize item spawns.

Thanks in advance.
Report, edit, etc...Posted by JaFF on 2006-07-31 at 11:28:21
QUOTE(FizzleBoink @ Jul 31 2006, 06:19 PM)
Okay! I'm not too good with randomizing item spawns and have come to ask for aid in the development of the triggers. My dilemma is that I have six items and would like for each one of them to spawn at different times, however I would like some items to appear less frequently than a few others. As you might have guessed, I have no idea how to do this and how to properly randomize item spawns.

Thanks in advance.
[right][snapback]535459[/snapback][/right]

I don't understand what are you trying to do. You want to create a random item in each place. And make it so that in each plce items appear not so fast as in other places ? Or... blink.gif
Report, edit, etc...Posted by Kyuubi. on 2006-07-31 at 11:36:03
I might be able to help,
here's a method. you could use switches. Make 3 different switches. in the beginning, make it always randomize the switches 1, 2, and 3(dont need the preserve trigger). 3 switches means 8 possbilities you can set, but since you wanted 6, you can have the extra 2 possibilities to pop up more frequently.

anyway, make a trigger for each the possbilities, 8 in this case.
example trigger would be,

[Possibility 1];
Conditions:
-switch 1 is clear
-switch 2 is clear
-switch 3 is clear
Actions:
-Spawn powerup or whatever you want to happen
-randomize switch 1
-randomize switch 2
-randomize switch 3
-preserve trigger

[Possibility 2];
Conditions:
-switch 1 is clear
-switch 2 is Set
-switch 3 is clear
Actions:
-Spawn powerup or whatever you want to happen
-randomize switch 1
-randomize switch 2
-randomize switch 3
-preserve trigger

and so on..

the items will spawn one at a time but you might have to put in some wait seconds or something to prevent it from the massfire of it...it'll swpawn randomly around the map if you want it to, i can help you more if you catch me online...
Report, edit, etc...Posted by Xx.Doom.xX on 2006-07-31 at 12:08:17
Yea, use the Randomize Switch to make random items appear at locations.
Report, edit, etc...Posted by AshaMeD on 2006-07-31 at 12:21:28

Trigger
Description:
Trigger
Players:
¤ Dosn't matter
Conditions:
¤ Always
Actions:
¤ Set switch *Random
¤ Random Switch -Random1
¤ Random Switch -Random2
¤ perserve Trigger



Trigger
Description:
Next
Players:
¤ Dosn't matter
Conditions:
¤ Switch Random= Set
¤ Switch Random1 =set
¤ Switch Random2=s
Actions:
¤ Add player8 Death counter 1
¤ Preserve Trigger


Then do the same thing with you know set,set clear,clear clear,set ,set, clear
but add 1 more... so the next trigger would be 2 then 3,4.

After you have that done make another trigger say like player 8 has 250 deaths.. of the counter u used set back 2 0... So now you have a death loop....

Now for the most common items... like like player 8 has exacly 10,25,62,203,259
and then for less common items do it less like 15,29,53, and for really rare items mby just 1... 22 deaths... Or somthing!!

This may be kinda confusing but it works way way good! >< have any questions i will explain just ask!

Report, edit, etc...Posted by Kenoli on 2006-07-31 at 12:42:39
There is a tutorial on how to do randomization.
I recommend using "1 Switch Randomization".

You'll have conditions like
Player has suffered at least 37 deaths of Unit.
instead of
Switch 1 is Set
Switch 2 is Cleared
Switch 3 is Set
Switch 4 is Cleared
Switch 5 is Cleared
Switch 6 is Set
Switch 7 is Cleared
Switch 8 is Cleared
Report, edit, etc...Posted by Syphon on 2006-07-31 at 13:18:31
You could have an area with wandering units, and make some locations bigger for more common items. Then just override it when you need to make a specific item appear.
Report, edit, etc...Posted by FizzleBoink on 2006-08-01 at 08:06:54
I've read the randomization tutorial many times, helpful but I'm still unable to properly set up triggers. Also one Switch randomization? area with wandering units? Can you two elaborate a little bit more on how these function, maybe provide a sample trigger?

Thanks again.
Report, edit, etc...Posted by n0b0dy- on 2006-08-01 at 08:29:58
Well, depending on how many items you need to be created you can use X number of switches.

Basically by randomizing the switches, a random item will appear at every location that you wanted.


Trigger 1:

Always
-----------------
Randomize Switch 1
Randomize Switch 2
And so on for however many you need


Trigger 2:

Switch 1 is set
Switch 2 is set
-----------------
Create one Potion at the location ITEM SPAWN1
Clear Switch 1
Clear Switch 2


This would create a potion at that location. Also, you will need to have NO triggers running on "Switch 1 is cleared" "Switch 2 is cleared" Then you would create another trigger at another location.

Trigger ?:
Switch 1 is set
Switch 2 is set
-----------------
Create one ether at location ITEM SPAWN2
Clear switch 1
Clear switch 2


Simply expand upon this, and you can have a random item spawn.
Report, edit, etc...Posted by Kenoli on 2006-08-01 at 10:31:45
1 switch randomization is pretty easy.
To do it, set up trggers like this:
QUOTE(Trigger)
Always.
----------
Modify death counts for Player: Set to 0 for Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 128 for DC: Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 64 for DC: Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 32 for DC: Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 16 for DC: Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 8 for DC: Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 4 for DC: Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 2 for DC: Random.
QUOTE(Trigger)
Always.
----------
Randomize Switch 1.
QUOTE(Trigger)
Switch 1 is Set.
----------
Modify death counts for Player: Add 1 for DC: Random.
After this, the death count for "Random" will be a random value 0-255.

Let's say you had 2 different items to spawn, but you wanted one of them to be three times as common as the other. You could just do this:
QUOTE(Trigger)
Player has suffered at least 0 deaths of Random.
Player has suffered at most 191 deaths of Random.
----------
Item one: 75% chance
QUOTE(Trigger)
Player has suffered at least 192 deaths of Random.
Player has suffered at most 255 deaths of Random.
----------
Item two: 25% chance
You can change the frequency of the item spawn very easily by adjusting the range of numbers that activate them.
Using 0-255 for only 2 items is overkill, but you get the idea.

You would probably want to add some kind of activator to the item-creating triggers, like "Player has suffered at at least 1 deaths of INeedAnItem" then, after you make the item, invalidate it with "Modify death counts for Player: Subtract 1 for INeedAnItem".
Report, edit, etc...Posted by Falkoner on 2006-08-01 at 12:12:23
Okay, to find out how many outcomes you'll get from randomization you have to take the number of switches you have to the power of 2, then that should tell you how many outcomes, okay, now the randomization is simply randimizing and making a trigger for every possible combination of switches that could come out,so, heres how it'd go with 1 switch:

Conditions:
This player buys some item

Actions:
Randomize switch 1
Teleport the player at that spot somewhere else so you know who is buying(optional)
preserve trigger

Conditions:
Switch 1 is cleared
and this player has one unit at the place he was teleported to

Actions:
Give them one zergling
Clear switch one
preserve trigger
Teleport their unit away.

Conditions Switch1 is set
and that player has his unit in the telportation place

Actions Give them one muta
Clear switch 1
preserve trigger
Teleport their unit away

For more than 1 switch you'd just have to find more outcomes
Report, edit, etc...Posted by AshaMeD on 2006-08-01 at 12:18:15
Listen 2 wat Kenoli said... Thats exacly wat i wrote yesterday... But for some reason it didn't post.. it did... and then i came back and it was gone ><!!
And i didn't want 2 retype it lol!! But thats the best best way 2 have somthing completly random

And have a DC loop like when ur DC get 2 like 250 start back 2 0.... and if u want common items make it like DC 12,14,20,25,30,37,40,50,100,123,152,200,215 thats pretty common..... but if u want a rare item do like 5,15,132,222 Thats pretty rare!! Its a quite easy also!
Report, edit, etc...Posted by MoonlighTurtle on 2006-08-01 at 13:20:05
Just so you know, the way Kenoli posted 1 switch randomization is a modified (better) way to do it. The triggers he posted complete the randomization in 1 trigger cycle, while the way the tutorial says to make the triggers has the randomization take 1 cycle for each time the switch has to be randomized.

Really the only difference is that as you can see in the triggers Kenoli posted is that there is a trigger to randomize the switch in every other trigger.
Report, edit, etc...Posted by FizzleBoink on 2006-08-01 at 21:44:36
Ah I see! Thank you Kenoli and everybody else who posted! biggrin.gif
Next Page (1)