If i make a map with two objectives, how i change the position/location of objectives (like The Hunt stock map) ????
Random location for objectives ???
Moderator: Moderators
Random location for objectives ???
I search in internet but dont find nothing (tutorial) about this question.
If i make a map with two objectives, how i change the position/location of objectives (like The Hunt stock map) ????
If i make a map with two objectives, how i change the position/location of objectives (like The Hunt stock map) ????
Hunt
You must study "The Hunt" script (obj_team1.scr). Look for this line------->
$flak88_weapon1_trigger thread flak88_random_setup $flak88_weapon1_explosive $flak88_weapon1 $flak88_target1 $flak88_base1 4
and this thread------->
flak88_random_setup local.explosive local.weapon local.point_at local.base local.number_of_locations:
The first line sends targetnames, and a number, to the thread. The thread assigns local variable names to each of them.
For a second objective, you would need to repeat the first line with different targetnames. It would seem to be simple, but in reality it is more complex because you don't want both objectives to appear in the same random location.
Hope that helps a little.
$flak88_weapon1_trigger thread flak88_random_setup $flak88_weapon1_explosive $flak88_weapon1 $flak88_target1 $flak88_base1 4
and this thread------->
flak88_random_setup local.explosive local.weapon local.point_at local.base local.number_of_locations:
The first line sends targetnames, and a number, to the thread. The thread assigns local variable names to each of them.
For a second objective, you would need to repeat the first line with different targetnames. It would seem to be simple, but in reality it is more complex because you don't want both objectives to appear in the same random location.
Hope that helps a little.
Re: Hunt
Tom,tltrude wrote:You must study "The Hunt" script (obj_team1.scr). Look for this line------->
$flak88_weapon1_trigger thread flak88_random_setup $flak88_weapon1_explosive $flak88_weapon1 $flak88_target1 $flak88_base1 4
and this thread------->
flak88_random_setup local.explosive local.weapon local.point_at local.base local.number_of_locations:
The first line sends targetnames, and a number, to the thread. The thread assigns local variable names to each of them.
For a second objective, you would need to repeat the first line with different targetnames. It would seem to be simple, but in reality it is more complex because you don't want both objectives to appear in the same random location.
Hope that helps a little.
Ok, i understand.
My question is: i need put triggers or another object to send the object, or simply pass the x y z coordinates of new position ?
location
Yes, there would need to be another set of entities in the map.
I have never done a random objective map, much less one for two objectives. But, this line is how it picks one of four locations for the flakk cannon in The Hunt.
local.location = ((randomint (local.number_of_locations)) + 1)
The locations are probable script_origins in the map that have targetnames like these.
$flak88_location1
$flak88_location2
$flak88_location3
$flak88_location4
So, I guess you could spawn more locations using coordinates. But if you are making the map in radient, you can just add more script_origin entities. Or, you can add an "if" line in the setup thread to check if the location is already being used by the first objective. And if it is, the setup thread would run again--until it picks one that is not being used.
I have never done a random objective map, much less one for two objectives. But, this line is how it picks one of four locations for the flakk cannon in The Hunt.
local.location = ((randomint (local.number_of_locations)) + 1)
The locations are probable script_origins in the map that have targetnames like these.
$flak88_location1
$flak88_location2
$flak88_location3
$flak88_location4
So, I guess you could spawn more locations using coordinates. But if you are making the map in radient, you can just add more script_origin entities. Or, you can add an "if" line in the setup thread to check if the location is already being used by the first objective. And if it is, the setup thread would run again--until it picks one that is not being used.
trigger
The gun's trigger_use "$flak88_weapon1_trigger " would also have to be added. In the setup thread the trigger is called "self".
Also, the script_origin that is used as an directional target "$flak88_target1"--it makes the gun and base point the right way.
"$flak88_weapon1_explosive" is probably the red flashing bomb model and it is probably a script_model.
There must be an easier way--this gun just has to many parts!!!
Also, the script_origin that is used as an directional target "$flak88_target1"--it makes the gun and base point the right way.
"$flak88_weapon1_explosive" is probably the red flashing bomb model and it is probably a script_model.
There must be an easier way--this gun just has to many parts!!!
