
Charged_Buffalo
Joined: Oct 23, 2011
Good at: Editing .tifs, but nothing too fancy.
|
Posted: Oct 25, 2011 03:12 PM
Msg. 1 of 7
OK, now that I have a map created, I have moved on to vehicle and weapon placement. I want to script more than 6 vehicle types into the map, but I am having difficulty doing so. Code from http://http://forum.halomaps.org/index.cfm%3Fpage=topic&topicID=35139 : (global boolean server 0)
(script startup vehicles (if (>= (unit_get_health host_check) 0) (set server 1) ) (if (= server 1) (begin (object_create "first vehicle") (object_create "second vehicle") ;; etc, repeat for each one ) ) )
(script continuous respawn_stuff (if (= server 1) (begin (if (volume_test_object "trigger volume name" "first vehicle") (object_create_anew "first vehicle") ) (if (volume_test_object "trigger volume name" "second vehicle") (object_create_anew "second vehicle") ) ;; repeat each of these (if)'s for each vehicle. Use copy-pasting to do it faster. ) (sleep_until (= 0 1)) ) )
This generates an error in Sapien which generates this error: [big line 2] i expected (script <type> <name> <expressions(s)>): (script startup recompiling scripts after scenarios were merged this left parenthesis is unmatched.: (script startup
I understand that 'big' refers to the script name, but I do not understand how to correct the error. Please may can someone reply as soon as possible.
|
|
|

sargejohnson
Joined: Apr 20, 2009
Shall we play a game?
|
Posted: Oct 25, 2011 11:49 PM
Msg. 2 of 7
You did remove the comments did you? (ie. the lines with ;;)
Also, can I see the actual script you are using for your map? This script is for reference only.
|
|
|

Charged_Buffalo
Joined: Oct 23, 2011
Good at: Editing .tifs, but nothing too fancy.
|
Posted: Oct 26, 2011 09:20 AM
Msg. 3 of 7
I have not removed the comments. Should I? Also, there are many scripts I have tried. Here are two: First, made with Easy Halo Scripter v2: (global boolean is_server false) (script startup (begin (if (= (unit_get_health check_vehicle) 0.0) (begin (set is_server true) (object_destroy check_vehicle) (object_create yohog_1) (object_create yohog_2) (object_create yohog_3) (object_create nug_1) ) ) ) ) (script continuous (begin (if (= is_server true) (begin (if (= (volume_test_object trigger_1 yohog_1) true) (begin (object_teleport yohog_1 yohog_1) (object_set_facing yohog_1 yohog_1) ) ) (if (= (volume_test_object trigger_1 yohog_2) true) (begin (object_teleport yohog_2 yohog_2) (object_set_facing yohog_2 yohog_2) ) ) (if (= (volume_test_object trigger_1 yohog_3) true) (begin (object_teleport yohog_3 yohog_3) (object_set_facing yohog_3 yohog_3) ) ) (if (= (volume_test_object trigger_1 nug_1) true) (begin (object_teleport nug_1 nug_1) (object_set_facing nug_1 nug_1) ) ) ) ) ) ) 2nd Attempt (with guide): (script startup vehiclespawn (object_create_anew yohog_1) (object_create_anew yohog_2) (object_create_anew yohog_3) (object_create_anew nug_1) ) Edited by Charged_Buffalo on Oct 26, 2011 at 09:22 AM
|
|
|

Spartan314
Joined: Aug 21, 2010
Former biped rigger & FP animator
|
Posted: Oct 26, 2011 02:48 PM
Msg. 4 of 7
Quote: --- Original message by: Charged_Buffalo2nd Attempt (with guide): (script startup vehiclespawn (object_create_anew yohog_1) (object_create_anew yohog_2) (object_create_anew yohog_3) (object_create_anew nug_1) ) Edited by Charged_Buffalo on Oct 26, 2011 at 09:22 AM ^That should suffice. Name your custom vehicles (or vehicles that aren't in globals.globals) yohog_1, yohog_2, yohog_3, and nug_1. Not the .vehicle itself, but in sapien. In the vehicle placement there should be name where you type that in.
|
|
|

Charged_Buffalo
Joined: Oct 23, 2011
Good at: Editing .tifs, but nothing too fancy.
|
Posted: Oct 26, 2011 04:24 PM
Msg. 5 of 7
I have now done this, but I have encountered two new problems:
1: Vehicle spawn points are not used by the vehicles, and they spawn either next to the Trigger Volume or next to the h..._control vehicle.
2: Weapons do not spawn at all, which they used to when the script was not compiled.
I don't think I need the Trigger Volume and the h..._control (I think that is roughly what it is called). If I remove these, will it solve Problems 1 and 2?
Edit: I have removed the vehicle and the trigger volume. It has fixed the weapon fault, but not the vehicle spawning issue. It seems that the vehicles spawn 'into' the first vehicle, and creating a spray of vehicles. How do I correct this, and make the vehicles spawn in the correct place? Edited by Charged_Buffalo on Oct 26, 2011 at 07:36 PM
|
|
|

sargejohnson
Joined: Apr 20, 2009
Shall we play a game?
|
Posted: Oct 27, 2011 08:22 AM
Msg. 6 of 7
Quote: --- Original message by: Charged_Buffalo I have not removed the comments. Should I? Edited by Charged_Buffalo on Oct 26, 2011 at 09:22 AM You should remove the comments, IIRC they do interfere with the compiling even with the ;; Of course, that is using the method in my post. I'm not too sure about the Easy Halo Scripter method, as I rarely use it, but I do know that your 2nd attempt definitely would not work, because by default Halo spawns all "extra" vehicles to first vehicle's spawn point. By the way, if you follow the method in the thread you quoted (the tutorial I gave the other guy) right down to the letter, everything should work, with the only things you need to change being the names of the vehicles you want to add to the map.
|
|
|

Charged_Buffalo
Joined: Oct 23, 2011
Good at: Editing .tifs, but nothing too fancy.
|
Posted: Oct 27, 2011 11:34 AM
Msg. 7 of 7
Thanks sargejohnson! After reading the guide through properly, I realised that I had not put the NONE spawning vehicle inside of the trigger volume! But just for the record, I will put my code up, as a use-able example. Thanks goes out to Spartan314 too! My code: (global boolean server 0)
(script startup vehicles (if (>= (unit_get_health host_check) 0) (set server 1) ) (if (= server 1) (begin (object_create yohog_1) (object_create yohog_2) (object_create yohog_3) (object_create nug_1) (object_create g_1) ) ) )
(script continuous respawn_stuff (if (= server 1) (begin (if (volume_test_object trigger_1 yohog_1) (object_create_anew yohog_1) ) (if (volume_test_object trigger_1 yohog_2) (object_create_anew yohog_2) ) (if (volume_test_object trigger_1 yohog_3) (object_create_anew yohog_3) ) (if (volume_test_object trigger_1 nug_1) (object_create_anew nug_1) ) (if (volume_test_object trigger_1 g_1) (object_create_anew g_1) ) ) (sleep_until (= 0 1)) )
|
|
|
| |
|
|
 |
|