A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE Technical / Map Design »script problem

Author Topic: script problem (8 messages, Page 1 of 1)
Moderators: Dennis

sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: Nov 30, 2009 03:26 AM    Msg. 1 of 8       
Hi.
i made a script that allows me to pick up ai, then drop them off anywhere using the flashlight button:

(script continuous empty1
(begin
(if
(and
(= (unit_get_current_flashlight_state (unit (list_get (players) 0))) true)
(vehicle_test_seat mhog W-driver (unit (list_get (players) 0)))
(begin
(vehicle_unload mhog)
(unit_enter_vehicle
(unit (list_get (players) 0)) mhog W-driver)
(unit_set_desired_flashlight_state (unit (list_get (players) 0)) false))))))


but when i compiled the script with sapien, i got this:
11.30.09 16:20:49 sapien pc 01.00.00.0609 ----------------------------------------------
11.30.09 16:20:49 reference function: _write_to_error_file
11.30.09 16:20:49 reference address: 401b13
11.30.09 16:20:49 Couldn't read map file './sapienbeta.map'
11.30.09 16:20:50 CreateDevice succeeded with refresh rate = 0
11.30.09 16:20:50 Sound card doesn't meet minimum hardware requirements. Disabling hardware option.
11.30.09 16:20:51 Increasing sound decompression buffer size to 1048576 bytes
11.30.09 16:21:37 recompiling scripts after scenarios were merged.
11.30.09 16:21:37 this left parenthesis is unmatched.: (if

11.30.09 16:21:37 DirectInput: 'Acquire (keyboard)' returned (DIERR_OTHERAPPHASPRIO#-2147024891)
11.30.09 16:21:38 local player 0, weapon (0x0), deleted unexpectedly
11.30.09 16:22:03 [empty_scriptg line 3] i expected (if []).: (if

11.30.09 16:22:03 recompiling scripts after scenarios were merged.
11.30.09 16:22:03 this left parenthesis is unmatched.: (if

any idea how to fix it?


H Guru
Joined: Oct 15, 2006

EHSv3 Coming Soon!


Posted: Nov 30, 2009 04:02 AM    Msg. 2 of 8       
Not 100% sure if this will work but test it.

(script continuous empty1
(begin
(if
(and
(= (unit_get_current_flashlight_state mhog) true)
(= (vehicle_test_seat mhog W-driver (unit (list_get (players) 0))))
)
(begin
(vehicle_unload mhog)
(unit_enter_vehicle (unit (list_get (players) 0)) mhog W-driver)
(unit_set_desired_flashlight_state mhog) false)
)
)
)


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: Nov 30, 2009 05:42 AM    Msg. 3 of 8       
thanks for the script H Guru, but it doesn't work.
here's the new debug.txt paragraph after using your script:

11.30.09 18:40:45 sapien pc 01.00.00.0609 ----------------------------------------------
11.30.09 18:40:45 reference function: _write_to_error_file
11.30.09 18:40:45 reference address: 401b13
11.30.09 18:40:45 Couldn't read map file './sapienbeta.map'
11.30.09 18:40:46 CreateDevice succeeded with refresh rate = 0
11.30.09 18:40:46 Sound card doesn't meet minimum hardware requirements. Disabling hardware option.
11.30.09 18:40:46 Increasing sound decompression buffer size to 1048576 bytes
11.30.09 18:40:48 recompiling scripts after scenarios were merged.
11.30.09 18:40:48 this left parenthesis is unmatched.: (and

11.30.09 18:40:48 local player 0, weapon (0x0), deleted unexpectedly
11.30.09 18:40:53 [empty_scriptg line 6] the = call requires 2 arguments.: (= (vehicle_test_seat mhog W-driver (unit (list_get (players) 0))))

11.30.09 18:40:53 recompiling scripts after scenarios were merged.
11.30.09 18:40:53 [empty_scriptg line 4] this left parenthesis is unmatched.: (and
any solution?


H Guru
Joined: Oct 15, 2006

EHSv3 Coming Soon!


Posted: Nov 30, 2009 12:00 PM    Msg. 4 of 8       
Have a try with this;
(script continuous empty1
(begin
(if
(and
(= (unit_get_current_flashlight_state mhog) true)
(= (vehicle_test_seat mhog "driver" (unit (list_get (players) 0))))
)
)
(begin
(vehicle_unload mhog)
(unit_enter_vehicle (unit (list_get (players) 0)) mhog "driver")
(unit_set_desired_flashlight_state mhog false)
)
)
)


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Nov 30, 2009 06:31 PM    Msg. 5 of 8       
Quote: --- Original message by: H Guru

(= (vehicle_test_seat mhog "driver" (unit (list_get (players) 0))))


The problem with this, is that the = command requires two arguments. Only one argument is given. I'm guessing in this case, you want it to work when the player is in the driver seat of the mhog. To accomplish this, you could either add a "true", as the vehicle_test_seat is a boolean. Or, remove the (= clause altogether.


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: Dec 1, 2009 08:44 AM    Msg. 6 of 8       
Ok, fixed the script according to what Gamma927 said, it now looks like this:

(script continuous empty1
(begin
(if
(and
(= (unit_get_current_flashlight_state mhog) true)
(= (vehicle_test_seat mhog W-driver (unit (list_get (players) 0))) true)
)
(begin
(vehicle_unload mhog)
(unit_enter_vehicle (unit (list_get (players) 0)) mhog W-driver)
(unit_set_desired_flashlight_state mhog) false)
)
)
)


and sapien still thinks there is a mistake with the script, which is this:

12.01.09 21:37:24 sapien pc 01.00.00.0609 ----------------------------------------------
12.01.09 21:37:24 reference function: _write_to_error_file
12.01.09 21:37:24 reference address: 401b13
12.01.09 21:37:24 Couldn't read map file './sapienbeta.map'
12.01.09 21:37:24 CreateDevice succeeded with refresh rate = 0
12.01.09 21:37:25 Sound card doesn't meet minimum hardware requirements. Disabling hardware option.
12.01.09 21:37:25 Increasing sound decompression buffer size to 1048576 bytes
12.01.09 21:38:13 recompiling scripts after scenarios were merged.
12.01.09 21:38:13 this left parenthesis is unmatched.: (and

12.01.09 21:38:14 local player 0, weapon (0x0), deleted unexpectedly
12.01.09 21:38:18 [empty_scriptg line 9] the "vehicle_unload" call requires exactly 2 arguments.: (vehicle_unload mhog)

12.01.09 21:38:18 recompiling scripts after scenarios were merged.
12.01.09 21:38:18 [empty_scriptg line 8] this left parenthesis is unmatched.: (begin

from the debug, i have a feeling that the seat names have to be added manually to the vehicle_unload part, but i am not sure.
any ideas?


killer kiwi
Joined: Feb 10, 2007

live and let die


Posted: Dec 1, 2009 10:24 AM    Msg. 7 of 8       
Quote: from the debug, i have a feeling that the seat names have to be added manually to the vehicle_unload part, but i am not sure.
any ideas?


Yes that is correct the line should be (vehicle_unload mhog W-driver)

also there is a problum with this line

(unit_set_desired_flashlight_state mhog) false)

it should be (unit_set_desired_flashlight_state mhog false)

the whole script which i have got to compile is

(script continuous empty1		
(begin
(if
(and
(= (unit_get_current_flashlight_state mhog) true)
(= (vehicle_test_seat mhog W-driver (unit (list_get (players) 0))) true)
)
(begin
(vehicle_unload mhog W-driver)
(unit_enter_vehicle (unit (list_get (players) 0)) mhog W-driver)
(unit_set_desired_flashlight_state mhog false)
)
)
)
)


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: Dec 2, 2009 03:04 AM    Msg. 8 of 8       
ok, tried out the script and it works!
thanks :)

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 1:48 AM 140 ms.
A Halo Maps Website