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 General Discussion »i expected a script or variable definition.: ( what is this?

Author Topic: i expected a script or variable definition.: ( what is this? (20 messages, Page 1 of 1)
Moderators: Dennis

gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 10:15 AM    Msg. 1 of 20       
I put my script in data\levels\mapname\scrips and then compiled the scripts and it gave me this errorr.

i expected a script or variable definition.: (

what is it?
Edited by gruntpowered on Feb 25, 2011 at 10:16 AM


Codebrain
Joined: Sep 29, 2007

/meme


Posted: Feb 25, 2011 11:54 AM    Msg. 2 of 20       
"i expected a script or variable definition." means that when Sapien was looking through your script, it found something that wasn't either defined as a script definition or a variable definition.

"" is what it is complaining about, this isn't defined as a script or a variable. However these two characters do seem weird though...

Edit: forgot examples

Script definitions are like this:

(script continuous ai_respawn
(script startup map_start
(script static "void" keyes_alive
(script dormant sleeping

Variable definition can mean two things: an actual variable definition or a particular script command.

Variables are:

(global "boolean" global_dialog_on false )
(global "long" global_delay_music (* 30 300 ))
(global "short" global_random 0 )


While script commands are:

(ai_dialogue_triggers true )
(sleep 30 )
(sleep_until (not global_dialog_on ))

And etc.

Edited by Codebrain on Feb 25, 2011 at 11:59 AM


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 11:59 AM    Msg. 3 of 20       
(script startup a10
(sleep_until (volume_test_objects p1 (players))15)
(ai_place 1)
(game_save_no_timeout)
)


This is in
C:\Program Files\Microsoft Games\Halo Custom Edition\data\levels\domain\scripts

I am trying to walk into a trigger volume named p1 to place encounter named 1 and create checkpoint but it gives me this error


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 25, 2011 12:03 PM    Msg. 4 of 20       
Needs a space between the closing parentheses of the first line and 15 (the one before the end).

(script startup a10
(sleep_until (volume_test_objects p1 (players)) 15)
(ai_place 1)
(game_save_no_timeout)
)


Codebrain
Joined: Sep 29, 2007

/meme


Posted: Feb 25, 2011 12:09 PM    Msg. 5 of 20       
At the top of your script (if you are using variables, place this below them):

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

Then for your trigger volume script use this script instead, see if it works:

(sleep_until (volume_test_objects p1 (player0))

Never understood why some of the original campaign levels from Halo CE is using "(players) 15)" unless it means it's looking for any player in singleplayer (which wouldn't make sense because Halo 1 could only use 2 people anyway)

Edit: see if Gamma's post helps you first, go to mine if it doesn't
Edited by Codebrain on Feb 25, 2011 at 12:10 PM


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 12:14 PM    Msg. 6 of 20       
So once I kill two encounters starting the map then after i finnish off the 2nd encounter, i want to walk past a trigger vol. named p1 using the script called a10( i will change later) and spawn encounter named 1..(ai_spawn 1)

(script startup a10
(script static "unit" player0
(unit (list_get (players )0 )))
(sleep_until (volume_test_objects p1 (players)) 15)
(ai_place 1)
(game_save_no_timeout)
)

Where do i put this if My .senarieo is in
tags\levels\domain

Is the name of the triger the same as the script to make the trigger use that script?
Edited by gruntpowered on Feb 25, 2011 at 12:16 PM
Edited by gruntpowered on Feb 25, 2011 at 12:21 PM


Codebrain
Joined: Sep 29, 2007

/meme


Posted: Feb 25, 2011 12:20 PM    Msg. 7 of 20       
Go to your Halo Custom Edition Directory.

Then, go to data\levels and see if you have a folder named "domain". If not, make one.

Inside the "domain" folder, make another folder called "scripts". Put the script file in there. Make certain that the filetype of the script is .hsc
Edited by Codebrain on Feb 25, 2011 at 12:21 PM


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 12:28 PM    Msg. 8 of 20       
how do i post images?


Codebrain
Joined: Sep 29, 2007

/meme


Posted: Feb 25, 2011 12:30 PM    Msg. 9 of 20       
First, the trigger volume you call in your script must be the same name Sapien is using for that trigger volume.

If the trigger volume your scripting is called p1 in Sapien, then it must be p1 in the script as well.

As for posting images, have you uploaded them to a image hosting website or have you not?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 25, 2011 12:55 PM    Msg. 10 of 20       
(script startup a10
(sleep_until (volume_test_objects p1 (players)) 15)
(ai_place 1)
(game_save_no_timeout)
)

Either use this or the one below. The addition of the static script in the first case is redundant.

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

(script startup a10
(sleep_until (volume_test_object p1 player0) 15)
(ai_place 1)
(game_save_no_timeout)
)


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 01:09 PM    Msg. 11 of 20       
(script startup ai_spawn1
(sleep_until (volume_test_objects ai_spawn1 (players)) 15)
(ai_place ai_spawn1)
(game_save_no_timeout)
)


script name in foder= ai_spawn1
encounter name=ai_spawn1
trigger name=ai_spawn1

This is the first time i have ever atemptedd to script.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 25, 2011 01:59 PM    Msg. 12 of 20       
This wouldn't compile because the trigger volume, encounter, AND script all have the same names. Everything must have a unique name.


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 02:01 PM    Msg. 13 of 20       
so it would give that error?
If so then i might be able to fix it!


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 25, 2011 02:10 PM    Msg. 14 of 20       
That isn't the cause of your original error. Rather, I'm fairly sure it was the lack of a space between the parentheses and the 15. The new script that you were using fixes that. HOWEVER, that script itself would cause a different compile error. In order to compile successfully, you need to have a unique name for every item.


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 02:22 PM    Msg. 15 of 20       
[a10 line 1] this left parenthesis is unmatched.: (script startup a10
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (script startup a10

My script...

(script continuos a10
(sleep_until (volume_test_objects ai_spawn1 (players) 15)
(ai_place 1)
(game_save_no_timeout)
)

all i need to know is what to do whth this. i dont know what to change.
This is my last question.

Edited by gruntpowered on Feb 25, 2011 at 03:07 PM


Pepzee
Joined: Sep 9, 2010


Posted: Feb 25, 2011 03:55 PM    Msg. 16 of 20       
Quote: --- Original message by: gruntpowered

[a10 line 1] this left parenthesis is unmatched.: (script startup a10
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (script startup a10

My script...

(script continuos a10
(sleep_until (volume_test_objects ai_spawn1 (players) 15)
(ai_place 1)
(game_save_no_timeout)
)

all i need to know is what to do whth this. i dont know what to change.
This is my last question.

Edited by gruntpowered on Feb 25, 2011 at 03:07 PM

Looks like your missing a parenthesis, I could be wrong, but try this.

(script continuos a10
(sleep_until (volume_test_objects ai_spawn1 (players)) 15)
(ai_place 1)
(game_save_no_timeout)
)


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 05:36 PM    Msg. 17 of 20       
that does not work. it does the same thing. ill have to try that again when i get to a computer. and what is booleam.


Codebrain
Joined: Sep 29, 2007

/meme


Posted: Feb 25, 2011 09:59 PM    Msg. 18 of 20       
Boolean, in scripts means it is a variable that is either true or false.

Examples of booleans could be the following:

Lets say you had a firefight map and wanted a boss to appear at a certain wave. You would make a wave counter (a "short" variable) and a boss wave checker (a "boolean" variable)

If the wave counter was at a certain number, say 7, the boss wave checker would be set to true, and then the boss would appear.

Of course I'm certain Gamma has a better explanation that what I just said, however this is my understanding of it.


Dwood
Joined: Oct 23, 2007

Judge Ye Therefore


Posted: Feb 25, 2011 10:49 PM    Msg. 19 of 20       
BTW in a scripts or variable declaration you don't have to put quotes.

ie instead of:

(global "boolean" bool 0)
(script static "void" dostuff )

you can say

(global boolean bool 0)
(script static void dostuff )
Edited by Dwood on Feb 25, 2011 at 10:50 PM
Edited by Dwood on Feb 25, 2011 at 10:52 PM


gruntpowered
Joined: Feb 14, 2011

Halo CE annivarsary mod WIP


Posted: Feb 25, 2011 11:08 PM    Msg. 20 of 20       
thanks!!! I got it to work!!! Free end result after im done to all who commented before this one!!!!

(script startup Party time!!!!
(sleep_until (volume_test_objects Success!! (players)) 15)
(ai_place Smart people to help me!)
(game_save_no_timeout)
(I will never forget how to do this!)
)

 

 
Previous Older Thread    Next newer Thread







Time: Sun November 17, 2019 6:59 PM 250 ms.
A Halo Maps Website