Quote: --- Original message by: Hell_Jumper_056
so with the random range command your telling it to randomly pick which ever bots you choose? ill have to test this out.
No, the random range command in a script selects a value randomly between an upper and lower bound. For example,
(sleep (random_range 500 900 ))
...would choose an arbitrary period between 500 units and 900 units to pause the script. Hence, its possible to make the AI spawn dependent on the random value. Not sure exactly how its done, because you can't reference the value created by a random_range command in another script, but maybe Kirby can set some light.
I thought of an alternative but somewhat more unwieldy way this can be done. You could script a global short that adds 1 to itself every now and then, and resets itself when it reaches 0. For example,
(global short ai_encounter)
(script continuous blahblah
(set ai_encounter (+ ai_encounter 1)
)
(script continuous reset
(if (=10 ai_encounter)
(set ai_encounter 0)
))
Then you could have a separate set of scripts that spawn a unique encounter based on the value of the variable "ai_encounter" at the time. For example,
(script startup spawn_ai_1
(sleep_until (volume_test_objects aispawn (players))15)
(if (= 0 ai_encounter)
(ai_place alternative_encounter_0)
) )
...etc. Repeat for all values of the variable.
Alternatively, you could just choose to have more spawn points, that works too.
Quote: --- Original message by: Hell_Jumper_056
4. In the campaign all of the enemies spawn when you enter the next area. Is there a way to have them spawn when they come into view without creating a new section?
I'm not sure what you mean, but I think you're implying that AI spawn whenever you enter a new BSP. That's not true, in campaign levels there are all kinds of triggers that cause AI to spawn (e.g trigger volumes, the health status of other encounters etc). You can make AI spawn on virtually any condition. So yeah, hope it answers your question.
Edited by Polamee on Jan 20, 2014 at 05:18 AM