Page 1 of 1

Scripts

Posted: Sat Jun 23, 2007 6:58 pm
by Andrew_b
ok anyways...im making an AI mod...but i need the ai to spawn only when you walk through a trigger

So i made my trigger, Made my script compiled the script in Sapien (compiled fine) playef my map, but no AI came when i walked through the trigger

Heres my script

Code: Select all

(global short number 0)

; this is still here so it could be adapted for multiplayer...

(script startup spawn_ai

; Time to check if a player is inside our trigger "spawn_ai"

	(if (= (volume_test_object spawn_ai (list_get (players) number)) true)
		(begin

	; Woot woot - they're inside the volume... let's spawn one AI from our 
	; encounter "grunts"

		(ai true)
		(ai_set_respawn Humans true) ; assuming we want to
		(ai_place Humans)

		(ai_set_respawn Humans2 true) ; assuming we want to
		(ai_place Humans2)

		(ai_set_respawn Covenant true) ; assuming we want to
		(ai_place Covenant)

		(ai_set_respawn Covenant2 true) ; assuming we want to
		(ai_place Covenant2)

		(ai_place NR_Humans)

		(ai_place NR_Humans2)

		(ai_place NR_Covenant)

		(ai_place NR_Covenant2)

		(ai_place follow)

		) 

	) 

)
And my trigger is right here
Image

so can anyone tell me what im doing wrong?

thanks
-Andrew_b

Posted: Sun Jun 24, 2007 6:37 pm
by wanksta
let me say something... did you just copy someones elses script or did you write this... cause that script is weird.

do you just want too spawn a encounter when you walk into the trigger?
i wrote you a better script here

(script startup spawning_script
(sleep_until
(volume_test_objects
spawn_ai
(players))15)
(ai_place Covenant2)
(ai_place NR_Humans)
(ai_place NR_Humans2)
(ai_place NR_Covenant)
(ai_place NR_Covenant2)
(ai_place follow))

try and compile that one and see if it works.

Posted: Sun Jun 24, 2007 8:29 pm
by Andrew_b
yeah thanks for responding...a guy wrote me the basics...but he wrote it wrong...and malolo helped me

Posted: Tue Jun 26, 2007 9:40 pm
by Andrew_b
sorry for the double post/bump thing...but wanksta, do you know the script to make ai only spawn on race??? (i didnt want to make another topic, so i double posted)

Posted: Wed Jun 27, 2007 1:04 pm
by wanksta
no i dont think thats possible.