PDA

View Full Version : Need some help scripting.



117
April 5th, 2009, 06:51 PM
Right, so basically, I'm working on a map, and I want to use some AI as a way to keep people from running to the outer bounds of the map. Problem is, the AI I'm using is supposed to work with trigger volumes, which need scripting to work; I don't understand Halo's scripting language very well, and what I have done has basically not worked. If someone could point out what I've done wrong in these scripts or fix them, that would help a lot.


(script continuous noescape)
(sleep_until (volume_test_objects map_exterior_1 (players))15)
(ai_try_to_fight_player sentinels)
(ai_allegiance_broken "player" "sentinel")
(ai_allegiance_broken "human" "sentinel")
(script continuous noescape2)
(sleep_until (volume_test_objects map_exterior_2 (players))15)
(ai_try_to_fight_player sentinels)
(ai_allegiance_broken "player" "sentinel")
(ai_allegiance_broken "human" "sentinel")
(script continuous noescape3)
(sleep_until (volume_test_objects map_exterior_3 (players))15)
(ai_try_to_fight_player sentinels)
(ai_allegiance_broken "player" "sentinel")
(ai_allegiance_broken "human" "sentinel")
(script continuous noescape4)
(sleep_until (volume_test_objects map_exterior_4 (players))15)
(ai_try_to_fight_player sentinels)
(ai_allegiance_broken "player" "sentinel")
(ai_allegiance_broken "human" "sentinel")
(script continuous noescapeceiling)
(sleep_until (volume_test_objects map_ceiling (players))15)
(ai_try_to_fight_player sentinels)
(ai_allegiance_broken "player" "sentinel")
(ai_allegiance_broken "human" "sentinel")
(script continuous returntomap)
(sleep_until (volume_test_objects map_interior (players))15)
(ai_try_to_fight_nothing sentinels)
(ai_allegiance "player" "sentinel")
(ai_allegiance "human" "sentinel")
(script continuous icanhascheezburger)
(sleep_until (volume_test_objects cheezburger (players))15)
(sound_impulse_start sound\dialog\grunt\scripted\grunty_thirst none 1)
(ai_place roflgrunt)
(vehicle_load_magic roflgrunt "W-driver" roflhog)
(sleep_until (= (ai_living_count roflgrunt) 0) 15)
(sound_impulse_start sound\dialog\multiplayer1\warthog none 1)(If you can't tell, this "icanhascheezburger" code is something I was trying to get to work as well, just for fun.)

Here's the debug code:



04.05.09 18:49:10 Sain CE 01.00.00.0609 ----------------------------------------------
04.05.09 18:49:10 reference function: _write_to_error_file
04.05.09 18:49:10 reference address: 401b13
04.05.09 18:49:10 Couldn't read map file './sapienbeta.map'
04.05.09 18:49:10 CreateDevice succeeded with refresh rate = 0
04.05.09 18:49:11 Increasing sound decompression buffer size to 1048576 bytes
04.05.09 18:49:12 the meter definition ui\hud\cyborg shield does not specify a stencil bitmap group.
04.05.09 18:49:12 the meter definition ui\hud\cyborg body does not specify a stencil bitmap group.
04.05.09 18:49:12 recompiling scripts after scenarios were merged.
04.05.09 18:49:12 i expected (script <type> <name> <expression(s)>): (script continuous noescapeceiling)

04.05.09 18:49:12 i expected (script <type> <name> <expression(s)>): (script continuous noescape)

04.05.09 18:49:12 i expected (script <type> <name> <expression(s)>): (script continuous noescape2)

04.05.09 18:49:12 i expected (script <type> <name> <expression(s)>): (script continuous noescape3)

04.05.09 18:49:12 i expected (script <type> <name> <expression(s)>): (script continuous noescape)

04.05.09 18:49:12 i expected (script <type> <name> <expression(s)>): (script continuous icanhascheezburger)

04.05.09 18:49:12 i expected (script <type> <name> <expression(s)>): (script continuous returntomap)

04.05.09 18:49:12 local player 0, weapon (0x0), deleted unexpectedly
04.05.09 18:49:21 [ceiling line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescapeceiling)

04.05.09 18:49:21 [escapeattempt line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape)

04.05.09 18:49:21 [escapeattempt2 line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape2)

04.05.09 18:49:21 [escapeattempt3 line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape3)

04.05.09 18:49:21 [escapeattempt4 line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape4)

04.05.09 18:49:21 [icanhascheezburger line 1] i expected (script <type> <name> <expression(s)>): (script continuous icanhascheezburger)

04.05.09 18:49:21 [return line 1] i expected (script <type> <name> <expression(s)>): (script continuous returntomap)

04.05.09 18:49:21 recompiling scripts after scenarios were merged.
04.05.09 18:49:21 i expected (script <type> <name> <expression(s)>): (script continuous noescapeceiling)

04.05.09 18:49:21 i expected (script <type> <name> <expression(s)>): (script continuous noescape)

04.05.09 18:49:21 i expected (script <type> <name> <expression(s)>): (script continuous noescape2)

04.05.09 18:49:21 i expected (script <type> <name> <expression(s)>): (script continuous noescape3)

04.05.09 18:49:21 i expected (script <type> <name> <expression(s)>): (script continuous noescape4)

04.05.09 18:49:21 i expected (script <type> <name> <expression(s)>): (script continuous icanhascheezburger)

04.05.09 18:49:21 i expected (script <type> <name> <expression(s)>): (script continuous returntomap)Also, this is for a multiplayer map. (Yes, I know the NPCs won't sync over the internet normally. I saw a tutorial on Halomods that showed how to do some swaps and stuff in HHT to get them to sync. Aside from that, I don't entriely care if they sync or not, as long as they kill things trying to leave, basically.)

ShadowSpartan
April 5th, 2009, 08:18 PM
Your script syntax is incorrect. Here is an example of a correct script.


(script static unit player0
(unit (list_get (players) 0))
)Remove the parenthesis that is at the end of the script name in all of your scripts, and place it at the end of the script.

117
April 5th, 2009, 09:14 PM
I've done that, but I'm still getting errors:


04.05.09 21:11:53 [ceiling line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescapeceiling)

04.05.09 21:11:53 [escapeattempt line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape)

04.05.09 21:11:53 [escapeattempt2 line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape2)

04.05.09 21:11:53 [escapeattempt3 line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape3)

04.05.09 21:11:53 [escapeattempt4 line 1] i expected (script <type> <name> <expression(s)>): (script continuous noescape4)

04.05.09 21:11:53 [icanhascheezburger line 1] i expected (script <type> <name> <expression(s)>): (script continuous icanhascheezburger)

04.05.09 21:11:53 [return line 1] i expected (script <type> <name> <expression(s)>): (script continuous returntomap)

04.05.09 21:11:53 recompiling scripts after scenarios were merged.
04.05.09 21:11:53 i expected (script <type> <name> <expression(s)>): (script continuous noescapeceiling)

04.05.09 21:11:53 i expected (script <type> <name> <expression(s)>): (script continuous noescape)

04.05.09 21:11:53 i expected (script <type> <name> <expression(s)>): (script continuous noescape2)

04.05.09 21:11:53 i expected (script <type> <name> <expression(s)>): (script continuous noescape3)

04.05.09 21:11:53 i expected (script <type> <name> <expression(s)>): (script continuous noescape4)

04.05.09 21:11:53 i expected (script <type> <name> <expression(s)>): (script continuous icanhascheezburger)

04.05.09 21:11:53 i expected (script <type> <name> <expression(s)>): (script continuous returntomap)

Syuusuke
April 5th, 2009, 09:24 PM
You're missing elements in your lines it seems?

(script <type> <name> <expression(s)>): (script continuous returntomap <expression(s)>)

or is that last bit optional...?

117
April 5th, 2009, 09:32 PM
I'm not sure. Polar's trigger volume tut uses the same kind of line, I don't see why it wouldn't work with a different name for the trigger.

Polar's:



(script startup h4xmb
(sleep_until (volume_test_objects trig_1 (players))15) ; Pauses script execution, and checks every 1/2 second to see if a player walks into the trigger “trig_1².
(ai_place encount_1) ; Places the ai encounter “encount_1²
(sleep_until (= (ai_living_count encount_1) 0) 15) ; Pauses script execution, and checks every 1/2 second to see if the encounter “encount_1² has been totally wiped out.
(game_save) ; Checkpoint… done.
(sound_impulse_start sound\dialog\multiplayer1\killtacular none 1) ; Killtacular!
)

Mine:


(script continuous noescapeceiling
(sleep_until (volume_test_objects map_ceiling (players))15)
(ai_try_to_fight_player sentinels)
(ai_allegiance_broken "player" "sentinel")
(ai_allegiance_broken "human" "sentinel")
)

I don't get why it's asking for more stuff, considering Polar's is supposed to work just fine with the delay to wait for the trigger to be triggered... and the AI encounter placement shouldn't make a difference.

p0lar_bear
April 5th, 2009, 11:55 PM
Your latest errors still tell us that you did NOT edit the scripts and save them like we said.

Double check your script files, make sure you saved them after editing them, then post them here.

117
April 6th, 2009, 12:19 AM
I just figured out what I was doing wrong. It was just because I was editing files under tags, not data. Figures that I'd do something like that. lol