PDA

View Full Version : HCE Scripte in the solo player



GAIGHER
July 24th, 2011, 06:55 AM
Hello

My script does not work in the soloplayer.

My script "secret.hsc" in "data\levels\MyMap\scripts\" :

(script static "unit" player0
(unit (list_get (players )0 )))


(script startup say
(begin
(sleep_until (volume_test_objects trigger (players)) 15)
(sv_say "Wooooooooooooooooooo")
(sleep 1000)
)
)


In Sapien:
File > Compile scripts
Told "scripts successfully compiled."

The "Player starting points" :
http://img30.imageshack.us/img30/3100/startingl.jpg


The "Starting profiles" :
http://img88.imageshack.us/img88/5672/profilf.jpg

I add tigger for the scripte...


In game (² "map_name MyMap") :
http://img9.imageshack.us/img9/918/noting.png
Nothing in the trigger volume :tinfoil:

chrisk123999
July 24th, 2011, 09:26 AM
sv_say only works in multiplayer. Also you don't need the begin.

GAIGHER
July 24th, 2011, 09:56 AM
OK

I also test
Death Box

(script continuous box_killer
(if (= (volume_test_object trigger (list_get (players) 15)) true)
(begin
(unit_kill (unit (list_get (players) 15)))
)
)
)

And
Vehicle open door

(script continuous "door_open"
(if (= (volume_test_object trigger vehicle) true)
(device_set_position door 1.0)
)
)

And
Help window ( http://www.modacity.net/forums/showthread.php?13817-Question-Help-window/page2 )

(script startup trig_spawn
(begin
(sleep_until (volume_test_objects trigger (players)) 15)
(display_scenario_help 0)
)
)

Nothing in the game :suicide:

seanthelawn
July 24th, 2011, 10:07 AM
I thought you were player number 0 in single player?

GAIGHER
July 24th, 2011, 10:19 AM
0 1 2 ..... 15 16 17 .....
does not work

I tested

(script continuous "door_open_bouton"
(if ( = (device_get_position bouton) 1 )
(device_set_position door 1)
)
)
does not work

Really need to use "File > Compile scripts" for Soloplayer ?...

seanthelawn
July 24th, 2011, 12:25 PM
Make sure your scripts are in the right folder, otherwise you're just compiling nothing into your map. You can test this by purposely making a broken script and compiling it. If it comes up with an error, they're in the right folder. If it still says "scripts successfully compiled" then your scripts are in the wrong directory. I'm not at home computer right now and I haven't done Halo scripting in a month or two so that's all I can think of at the moment.

GAIGHER
July 24th, 2011, 01:17 PM
Yes
I tested


(script continuous "door_open_bouton"
(if ( = (device_get_position boutonxxxxxxxxx) 1 )
(device_set_position doorxxxxxxxxx 1)
)
)
(With a broken script)
Sapien told "scripts successfully compiled."

My script is in "data\levels\ya\scripts"
My scenario is in "tags\levels\ya"

I tested with a10 script
(I put a10.hsc in the "data\levels\ya\scripts")
Sapien told:
[a10 line 216] this is not a valid object name.: space_bomber_1 0.35 0 )
recompiling scripts after scenarios were merged.
[a10 line 214] this left parenthesis is unmatched.: (script static "void" bomber_setup

My script is in good location !
It is probably not complete :gonk:
What should I add ?

(script static "unit" player0
(unit (list_get (players )0 )))

(script continuous "door_open_bouton"
(if ( = (device_get_position bouton) 1 )
(device_set_position door 1)
)
)

seanthelawn
July 24th, 2011, 01:19 PM
Try something like "device_get_positionxxxx" rather than misspelling object names (not sure if it would pick up on that)

Although I'm pretty sure your scripts are in the right directory, judging from what you said.


E: Oops, didn't read the whole post. Not sure what else to try right now. Might test some things when I get home later to try to help you.

GAIGHER
July 24th, 2011, 01:30 PM
I renamed my script
He called "secret.hsc"
I renamed "a10.hsc"

Successful :lolugh: