Sorry for long post
I am trying to make a map similar to wilderness survival / troll tribes maps.
Started today and managed to do camp fire, cooking, crafting items, hero selection, random item spawns in regions with max item cap etc. Im surprised how easy it is but since im new to this im sure my solutions isnt the best.
Havent read the leak thread yet but will do once i get the hang on this so im not that concerned about leaks atm.
But i wonder, is it any better way to do random than to do like this:
RandomVariable = random(1-10)
if(RandomVariable = 1) do stuff
if(RandomVariable = 2)...
And more importmantly about the animals. How my spawning is right now(dunno how you write triggers on forum):
Event
Time - 10
Action
if(VariableAnimalCountRegion1 < 3)
Spawn animal
VariableAnimalCountRegion1 += 1
Event
Unit - dies
Action
{TempAnimalCountRegion1 = 0
Unit Group - Pick every unit in AnimalRegion1 and do actions
loop
{ Set TempAnimalCountRegion1 += 1 }
Set AnimalCountRegion1 = TempAnimalCountRegion1}
This works as long as animal stay in region, if they move out if it they keep spawning when any unit die. I tried with a Unit Group variable but i cant get it to work becouse they units is still in the Unit Group when they are dead and dont know how to remove them.
Is it a bad way by going through every unit every time a unit die and every item when a item is going to be spawned? Cant come up with a better solution to know where spawns is needed yet.
So my questions:
1. Is it any better way to ranomize what is gonna spawn or drop than i do?
2. What better solutions could i do for animals that spawn?
3. And also how can i get animals to move similar to how they move in wilderness survival and troll tribes? Wolfs i think i can use a attack move every now and then to random locations near the wolf.
Do i get right behaviour with Neutral Hostile, Neutral Victim, Neutral Extra and Neutral Passive? Havent tried what they do, only tried Hostile.
Or do i write in trigger that when a animal get attacked, if it is a animal that is afraid make it move to a position nearby? Or any other way?
I am trying to make a map similar to wilderness survival / troll tribes maps.
Started today and managed to do camp fire, cooking, crafting items, hero selection, random item spawns in regions with max item cap etc. Im surprised how easy it is but since im new to this im sure my solutions isnt the best.
Havent read the leak thread yet but will do once i get the hang on this so im not that concerned about leaks atm.
But i wonder, is it any better way to do random than to do like this:
RandomVariable = random(1-10)
if(RandomVariable = 1) do stuff
if(RandomVariable = 2)...
And more importmantly about the animals. How my spawning is right now(dunno how you write triggers on forum):
Event
Time - 10
Action
if(VariableAnimalCountRegion1 < 3)
Spawn animal
VariableAnimalCountRegion1 += 1
Event
Unit - dies
Action
{TempAnimalCountRegion1 = 0
Unit Group - Pick every unit in AnimalRegion1 and do actions
loop
{ Set TempAnimalCountRegion1 += 1 }
Set AnimalCountRegion1 = TempAnimalCountRegion1}
This works as long as animal stay in region, if they move out if it they keep spawning when any unit die. I tried with a Unit Group variable but i cant get it to work becouse they units is still in the Unit Group when they are dead and dont know how to remove them.
Is it a bad way by going through every unit every time a unit die and every item when a item is going to be spawned? Cant come up with a better solution to know where spawns is needed yet.
So my questions:
1. Is it any better way to ranomize what is gonna spawn or drop than i do?
2. What better solutions could i do for animals that spawn?
3. And also how can i get animals to move similar to how they move in wilderness survival and troll tribes? Wolfs i think i can use a attack move every now and then to random locations near the wolf.
Do i get right behaviour with Neutral Hostile, Neutral Victim, Neutral Extra and Neutral Passive? Havent tried what they do, only tried Hostile.
Or do i write in trigger that when a animal get attacked, if it is a animal that is afraid make it move to a position nearby? Or any other way?