Hey ive been experimenting with a system for custom hostility for a map project im working on.
The Map:
Im making a map where you control a species in a world of evolution, with new species mutating into existence all the time, and each player controlling their own species they have to manage and evolve.
Every unit has its custom value set to a specific race in my array of Races, which is an array of a struct created in jass, the race contains their damage, armor, lifespan, model (unit type), its type (plant/herbivore/carnivore) etc.
The Problem:
Everything works great, except that i need some custom hostility so that all predators will attack other predator races and attack plant eating races, but not members their own race. Since there are only 12 players, which i need for the player controlled races, i need a system to control hostility for alot of computer controlled races.
What ive been trying to do is a trigger that every second picks every predator on the map and checks if there is a member of a different species nearby, and then orders the unit to attack it.
All predators would be owned by the same player, but attack members of other races regardless.
I would like some thought about this system, do you think it would work or do you have a much better idea?
Thanks - jjonj
The Map:
Im making a map where you control a species in a world of evolution, with new species mutating into existence all the time, and each player controlling their own species they have to manage and evolve.
Every unit has its custom value set to a specific race in my array of Races, which is an array of a struct created in jass, the race contains their damage, armor, lifespan, model (unit type), its type (plant/herbivore/carnivore) etc.
The Problem:
Everything works great, except that i need some custom hostility so that all predators will attack other predator races and attack plant eating races, but not members their own race. Since there are only 12 players, which i need for the player controlled races, i need a system to control hostility for alot of computer controlled races.
What ive been trying to do is a trigger that every second picks every predator on the map and checks if there is a member of a different species nearby, and then orders the unit to attack it.
All predators would be owned by the same player, but attack members of other races regardless.
I would like some thought about this system, do you think it would work or do you have a much better idea?
Thanks - jjonj