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 question(s)

Author Topic: Script question(s) (22 messages, Page 1 of 1)
Moderators: Dennis

Vick Jr
Joined: Jun 26, 2008

Well enough alone...


Posted: Feb 9, 2009 05:54 PM    Msg. 1 of 22       
See latest post below.

1: It makes no difference whether a script (or global variable) is added as an individual file or as another script entry in a single file right? They are all compiled to the same place.

2: When is "(begin" needed and not needed?

3: 1 game tick = ___ seconds?

4: Does anyone know a good, free, down-loadable, safe LISP editor?

5: Anyone happen to know what the 5 arguments for (cinematic_screen_effect_set_convolution
) do?
(or any of the args for similar commands, like filter effect)
I think the last one is the time it takes to "convoluted"

6: How would I make a group of ai rise up into a grav lift from a covenant cruiser? Custom animation? Attach them to something invisible that moves up? Command list to jump really high?


7: Is there any way to stop a continuous script? (I remember a topic on this, but can't find it)
8: And PLEASE reply to these!
http://forum.halomaps.org/index.cfm%3Fpage=topic&topicID=23871
http://forum.halomaps.org/index.cfm%3Fpage=topic&topicID=23975

Thank you!
Edited by Vick Jr on Feb 9, 2009 at 05:55 PM
Edited by Vick Jr on Feb 9, 2009 at 05:57 PM
Edited by Vick Jr on Feb 13, 2009 at 06:03 PM


Molonky500
Joined: Aug 30, 2008

Xfire;killermax5


Posted: Feb 9, 2009 06:43 PM    Msg. 2 of 22       
for the lift it would have to be cutscene and then an animation is aplied to the bipeds etc


Vick Jr
Joined: Jun 26, 2008

Well enough alone...


Posted: Feb 9, 2009 07:35 PM    Msg. 3 of 22       
Quote: --- Original message by: Destroyer
Quote: --- Original message by: Vick Jr

1: It makes no difference whether a script (or global variable) is added as an individual file or as another script entry in a single file right? They are all compiled to the same place.
yeh, although on a scripting tutorial i read it said sapien will only compile 4 files
easy enough to test. I guess I'll find out.
2: When is "(begin" needed and not needed?

I'm not sure, it might be optional
Strange. i see it in the campaign maps after if statements and trigger volume testing. Perhaps it helps define what's inside and outside the if statement? Like (if bla bla)(begin
bla bla bla)

3: 1 game tick = 1\30 seconds
I thought so. Thanks
4: Does anyone know a good, free, down-loadable, safe LISP editor?
wuts LISP

LISP is the scripting language. I was hoping a LISP editor would help making scripts, since it has features like parenthesis match, auto-indent, color coordination, ect.
5: Anyone happen to know what the 5 arguments for (cinematic_screen_effect_set_convolution
) do?
(or any of the args for similar commands, like filter effect)
I think the last one is the time it takes to "convoluted"

6: How would I make a group of ai rise up into a grav lift from a covenant cruiser? Custom animation? Attach them to something invisible that moves up? Command list to jump really high?

an invisible lift maybe
could work. animated scenery with no render model.

7: Is there any way to stop a continuous script? (I remember a topic on this, but can't find it)
the only way i can think of is by making it so the script only works if there is a vehicle in a trigger volume, then another script deletes that vehicle and stops the continuous working

some sort of flag to stop the script from doing anything if a certain condition becomes false. It would work, but would be slightly waistfull.

8: And PLEASE reply to these!
http://forum.halomaps.org/index.cfm%3Fpage=topic&topicID=23871
http://forum.halomaps.org/index.cfm%3Fpage=topic&topicID=23975
Questions linger on.
Thank you!
Edited by Vick Jr on Feb 9, 2009 at 05:55 PM
Edited by Vick Jr on Feb 9, 2009 at 05:57 PM


Oh, and one more thing.
How do i make words fade in and out on the center of the screen. (with specific fonts and sizes if possible). It's for starting credits and info. I've seen it done before, Surf-Halloween public beta, though they weren't in the center of the screen. (sorry author, but i can't think of anywhere else i've seen it before.)

Is there any way to have like data streaming data info. Like in movies where you see the letters being typed at the bottom of the screen and the cursor and the beeping like data being entered into a computer. The sound could be a sound tag, and i guess i could print the first character, then the first and second, then the first, second, and third, etc. I don't know if you can change font or anything.

Edited by Vick Jr on Feb 9, 2009 at 07:59 PM
Edited by Vick Jr on Feb 9, 2009 at 08:00 PM


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Feb 9, 2009 09:40 PM    Msg. 4 of 22       
global variables will work threwout all the scripts. sapien imports hsc in alphabetic order, and will get pissed off if its referanced to before it is known. on each computer, sapien seems to alow differnt number of HSCs to be imported (my old PC only worked with 4 when other peoples let more, but I always make all my scripts for a map into one HSC anyways)

(begin ) is only to make multiple results act as one. the IF command.. it acualy gives you 2 corses of action, one if the first thing is true, one of the first thing is false... Anyways, if you dont want 5 billion if's of the same thing to preform all the results you want, you put (begin (blah) (blah2) ) instead of the single comand you want.

also, the sleep command.. it can acualy target another script.. ive never bothered to try how well it works, but that could stop a continuous.
another way you could do it you could use global varients that when its found false eventauly, it stops doing it (just start the continuous script with a sleep_until)

I dont remember which one is which in convolution, but its type, intensity, fade, and I dont remeber the others.. I am preaty sure the first option is type though (there are differnt blur effects)
just use this one as referance, and skrew around in devmode
(cinematic_screen_effect_start 1)
(cinematic_screen_effect_set_convolution 1 2 25 0 150)


Vick Jr
Joined: Jun 26, 2008

Well enough alone...


Posted: Feb 10, 2009 03:31 PM    Msg. 5 of 22       
That's what i thought. I noticed that, unlike in programming, "if" statements and other things don't have brackets to contain all the stuff that's supposed to happen for them. Instead, I guess the line following the if statement is exacuted if the if statement is true. But if the next statement is (begin, then everything within the begin is executed. This would work for any conditional statement, or for (sleep.

I don't know why the halo scripting bible has it's description of the (begin, "returns the last expression in a sequence after evaluating the sequence in order."

Yes, you could have a continuous script that starts with a sleep_until statement. May be more efficiant then an if statement to keep checking a flag every 1/60th second.

For instance, from the c10 scriot...

(script continuous play_flash
(sleep_until test_ffw_flash 1 )
(cinematic_set_title ffw )(sleep 60 ))

instead of something like

(script continuous play_flash
(if (= test_ffw_flash 1))
(cinematic_set_title ffw )(sleep 60 ))

Now how do else statements work?

if (something)
(DoThisIfTrue)
[(DoThisIfNotTrue)]

??
it said that the "else" is in [] things. i don't know. I'll try it.

The "(cond" thing could be used like a "select case" or instead of multiple if statements, but with no "else" options.

Thanks for the info on the blur effect. I'll keep messing with it.

What's the difference between an object and a uinit? When/how are they used?

Thanks again!
Edited by Vick Jr on Feb 10, 2009 at 04:24 PM


BeachParty clan
Joined: Oct 12, 2008

Sooo... You wanna switch to Red team huh?


Posted: Feb 10, 2009 05:33 PM    Msg. 6 of 22       
Quote: --- Original message by: Vick Jr
What's the difference between an object and a uinit? When/how are they used?
Edited by Vick Jr on Feb 10, 2009 at 04:24 PM

Object is for vehicles and scenery and weapons, units is the bipeds, if i'm correct.

also, i just try to keep my scripts seperate, since it's easier to just port a script over per script rather then cut paste it each time.

Yea the blur effect... without a bitmap it's going to be from the center to the outsides, depending on your values if they want to go from middle clear to outside blur, can even do it vice versa. there are options to make other patterns, but the best option is bitmaps. remember the pistol? blur on the outside, clear on the inside. that's because of the bitmap, if you use a clear part, then it's possible to make shapes and stuff like that, like the CoD effect, only the outer rings will be blurred, for example (I still don't know how to attach that script to the shield/health damage, but whatever)
So the point is, i'm making the blur effect in the hud itself and kornmann00 mainly, but now you mention it, I will mess around in dev to check that out, and try finding a variable that it triggers on shield/health hit (i'm not a LISP expert, just PHP and XHTML with it's variants)

Also, the titles effects like coldsnap, is just a scene title, like CMT does in their maps, (still wonder how to make a cutscene at the start and immidiatly end it, just for the bars effect)
Check out the levels tags at the bottem and you'll see a part where it says cutscene titles, if you start it on your whole level it will start with that with the given font, ammount of time and a load of other stuff you want to configure. Loads of options for that, you'll have to see it for yourself since I think I can go on with it for awhile, i'm not gonna try it =P
All I'm working on for the moment, is a variable for shield/health hit, bah i need to learn more LISP arguments...
Edited by BeachParty clan on Feb 10, 2009 at 05:37 PM


BeachParty clan
Joined: Oct 12, 2008

Sooo... You wanna switch to Red team huh?


Posted: Feb 10, 2009 06:56 PM    Msg. 7 of 22       
Quote: --- Original message by: l283023
*coughs*
Vehicles are units too.

Then I'm not correct, my bad =P


Vick Jr
Joined: Jun 26, 2008

Well enough alone...


Posted: Feb 10, 2009 07:40 PM    Msg. 8 of 22       
Ya, I saw your bitmap blurs and thay are awsome. Is there any way to apply them with a script, instead of haveing them as part of the hud?

I wans wondering, but it could also help you.

You can script them to come on when the player is injured.
Otherwize, you have to use some hud stuff. I don't know anything about hud.

Happen to know the script to show a cutscene title? They can be made and edited with the stringslist editor?

The script to toggle letterbox is
(cinematic_show_letterbox <boolean>)
just put that as true, then false at the beggining of the game.

Lisp is super easy.
All you need is this...
http://www.freewebs.com/desphm/HS_Bible.htm#return

However, i still don't know exactly how to do an if statement with an else option. (so much for easy lisp)
Should it be...

(if (conditiontocheck) (print "this is true") (print "this is false") )
....^condition^..........^do this if its true^..^do this if its false^.....

And would it matter if it was on seperate lines?

(if (condition
(print "this is true")
(print "this is false")
)

but that just doesn't seem right. it seems like it would do both of those if it was true, but niether if it was false. On second thought, evey place in the campaign scripts where multiple things must happen when if statements are true, they enclose them in (begin ).


Edited by Vick Jr on Feb 10, 2009 at 07:55 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Feb 10, 2009 07:43 PM    Msg. 9 of 22       
For the ai_place command, only put the encounter. Remove the /[squad]. Same for the ai_kill


MF Boom
Joined: Mar 5, 2007

I am the bone of my sword...


Posted: Feb 10, 2009 11:33 PM    Msg. 10 of 22       
Quote: --- Original message by: l283023
Quote: --- Original message by: BeachParty clan
Quote: --- Original message by: l283023
*coughs*
Vehicles are units too.

Then I'm not correct, my bad =P

I never said you were wrong.
Vehicles are both units and objects.
So are bipeds.


Actually, I don't believe vehicles are units. But I could be wrong... I know that bipeds, AI, and players are units. The Unit_kill consists of players, whereas, object_destroy_containing consists of vehicles or scenery usually...

I'm about 50% sure that Units are only bipeds/AI/players, whereas objects are vehicles/scenery, etcetera... Someone correct me, please, because that 50% chance I'm wrong is bugging me.


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Feb 11, 2009 12:00 AM    Msg. 11 of 22       
Quote: --- Original message by: MF Boom
Quote: --- Original message by: l283023
Quote: --- Original message by: BeachParty clan
Quote: --- Original message by: l283023
*coughs*
Vehicles are units too.

Then I'm not correct, my bad =P

I never said you were wrong.
Vehicles are both units and objects.
So are bipeds.


Actually, I don't believe vehicles are units. But I could be wrong... I know that bipeds, AI, and players are units. The Unit_kill consists of players, whereas, object_destroy_containing consists of vehicles or scenery usually...

I'm about 50% sure that Units are only bipeds/AI/players, whereas objects are vehicles/scenery, etcetera... Someone correct me, please, because that 50% chance I'm wrong is bugging me.

Vehicles are units. There are 3 types of unit tags, Bipeds, Vehicles, and plain .unit

If you look around the middle of the vehicle tag, you'll see $$$UNIT$$$.. now, that feature is acualy the seat, camera, and weapon slots. If you look in biped, you'll find identical things. If you are to look in .unit, you'll see that it is only just that section. You'll also notice in globals.globals the drop box beside the player.. you can use BIPED, UNIT, or VEHICLE (yes, it truely works being a vehicle.. and for what ever reason, even your enemys can ride you lol. you are always your driver, but people can aim your guns for you lol)

Units are under the subcatagory of objects. You can use object destroy on normal bipeds


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Feb 11, 2009 03:26 PM    Msg. 12 of 22       
Quote: --- Original message by: kirby_422
You'll also notice in globals.globals the drop box beside the player.. you can use BIPED, UNIT, or VEHICLE (yes, it truely works being a vehicle.. and for what ever reason, even your enemys can ride you lol. you are always your driver, but people can aim your guns for you lol)


Yup. I remember doing this a long time ago out of curiosity. I had a good laugh when I set the globals to use a coldsnap jet as the player unit in Death Island. I kept spawning in the base and getting stuck, and I kept trying to get out of my jet, forgetting that I was the jet.

Though, I never tested it with more players.

Edit: By enemies and other people you meant AI right? Because all players would just be other vehicles.
Edited by Me KS on Feb 11, 2009 at 03:58 PM


H Guru
Joined: Oct 15, 2006

EHSv3 Coming Soon!


Posted: Feb 11, 2009 03:43 PM    Msg. 13 of 22       
Quote: However, i still don't know exactly how to do an if statement with an else option. (so much for easy lisp)
Should it be...

(if (conditiontocheck) (print "this is true") (print "this is false") )
....^condition^..........^do this if its true^..^do this if its false^.....

And would it matter if it was on seperate lines?

(if (condition
(print "this is true")
(print "this is false")
)


Example:

(if (volume_test_object "Trigger volume" "Vehicle name")
(sv_say "Vehicle is in trigger volume."
)
(sv_say "Vehicle is not in trigger volume.")
)

If the "Vehicle name" is inside "Trigger volume"(= true) then
sv_say "Vehicle is in trigger volume."
Else
sv_say "Vehicle is not in trigger volume."

Edited by H Guru on Feb 11, 2009 at 03:48 PM


MF Boom
Joined: Mar 5, 2007

I am the bone of my sword...


Posted: Feb 11, 2009 05:49 PM    Msg. 14 of 22       
Quote: --- Original message by: kirby_422
Quote: --- Original message by: MF Boom
Quote: --- Original message by: l283023
Quote: --- Original message by: BeachParty clan
Quote: --- Original message by: l283023
*coughs*
Vehicles are units too.

Then I'm not correct, my bad =P

I never said you were wrong.
Vehicles are both units and objects.
So are bipeds.


Actually, I don't believe vehicles are units. But I could be wrong... I know that bipeds, AI, and players are units. The Unit_kill consists of players, whereas, object_destroy_containing consists of vehicles or scenery usually...

I'm about 50% sure that Units are only bipeds/AI/players, whereas objects are vehicles/scenery, etcetera... Someone correct me, please, because that 50% chance I'm wrong is bugging me.

Vehicles are units. There are 3 types of unit tags, Bipeds, Vehicles, and plain .unit

If you look around the middle of the vehicle tag, you'll see $$$UNIT$$$.. now, that feature is acualy the seat, camera, and weapon slots. If you look in biped, you'll find identical things. If you are to look in .unit, you'll see that it is only just that section. You'll also notice in globals.globals the drop box beside the player.. you can use BIPED, UNIT, or VEHICLE (yes, it truely works being a vehicle.. and for what ever reason, even your enemys can ride you lol. you are always your driver, but people can aim your guns for you lol)

Units are under the subcatagory of objects. You can use object destroy on normal bipeds


Oh, okay. I wasn't really sure. I've never messed around with it enough to figure it out, just messed with various things in dev' mode and such.

Also, that sounds strangely fun to do. I'm going to have to make a player vehicle in my map. :3


BeachParty clan
Joined: Oct 12, 2008

Sooo... You wanna switch to Red team huh?


Posted: Feb 11, 2009 05:55 PM    Msg. 15 of 22       
Quote: --- Original message by: MF Boom
Also, that sounds strangely fun to do. I'm going to have to make a player vehicle in my map. :3

*Puts Scarab in* BUFFER OVERLOAD, DUPLICATING TUTORIAL MAP 100 TIMES TO FIT 16 PLAYERS IN ODDVEHICLE GAMETYPE MODE


MF Boom
Joined: Mar 5, 2007

I am the bone of my sword...


Posted: Feb 11, 2009 08:27 PM    Msg. 16 of 22       
Quote: --- Original message by: BeachParty clan
Quote: --- Original message by: MF Boom
Also, that sounds strangely fun to do. I'm going to have to make a player vehicle in my map. :3

*Puts Scarab in* BUFFER OVERLOAD, DUPLICATING TUTORIAL MAP 100 TIMES TO FIT 16 PLAYERS IN ODDVEHICLE GAMETYPE MODE


No no no. Not a player playing as a vehicle; but the idea of a biped being a vehicle. Hopping into an AI, or having an AI hop into me...

I mean, think about it; it'd be fun to be ridden.

... That's what she said.


Vick Jr
Joined: Jun 26, 2008

Well enough alone...


Posted: Feb 11, 2009 09:08 PM    Msg. 17 of 22       
Hemm...this could be used with the (unit_suspend) to make players not have gravity. To make people not be able to ride you and have you use your own guns you can use scripts and change settings in guerilla. No one would notice anything was different, and they'd be like "hey, how'd you make no gravity?!"

Oh, and for the if statement, thanks for the confirmation. Does it matter where the parenthesis or lines start or begin? Could it all be on one line? or three?

Wow, this thread is taking off.

Please people, while you're here, reply to these as well!!!!!!...
http://forum.halomaps.org/index.cfm%3Fpage=topic&topicID=23975
http://forum.halomaps.org/index.cfm%3Fpage=topic&topicID=23871

Thanks for all the help!


BeachParty clan
Joined: Oct 12, 2008

Sooo... You wanna switch to Red team huh?


Posted: Feb 12, 2009 08:29 AM    Msg. 18 of 22       
Quote: --- Original message by: MF Boom
Quote: --- Original message by: BeachParty clan
Quote: --- Original message by: MF Boom
Also, that sounds strangely fun to do. I'm going to have to make a player vehicle in my map. :3

*Puts Scarab in* BUFFER OVERLOAD, DUPLICATING TUTORIAL MAP 100 TIMES TO FIT 16 PLAYERS IN ODDVEHICLE GAMETYPE MODE


No no no. Not a player playing as a vehicle; but the idea of a biped being a vehicle. Hopping into an AI, or having an AI hop into me...

I mean, think about it; it'd be fun to be ridden.

... That's what she said.

You know, KnightRider is a good movie.

What if we try to bump possess if so? wouldn't you just take over the body, and the vehicle would go on running you over because of the velocity? lol.

But if we can be a vehicle, why can't we bump possess it?


Vick Jr
Joined: Jun 26, 2008

Well enough alone...


Posted: Feb 13, 2009 05:40 PM    Msg. 19 of 22       
What's the difference between a static script and a dormant script? How do you call them? A static script can return something right? How? Which can be called multiple times? What are examples of each?

And why do I see (sleep -1) sometimes in the campaign scrips?

OK, here's what i want to do...

a player walks into "bubblebeetrig" and looks within 30 degrees of "floodarea" (a flag) and some stuff happens including objects being made and ai being placed (I have a chunk of script to make them all)

BUT when they look away and/or leave the trigger volume, the ai and objects are deleted ( i have a chunk of script to make them delete)

I don't care if this can only happen once per game, as long as it happens when it's supposed to, and deletes when it's supposed to, and causes minimal lag. Just tell me the script and where to put the create and destroy chunks.
Edited by Vick Jr on Feb 13, 2009 at 05:46 PM
Edited by Vick Jr on Feb 13, 2009 at 05:49 PM
Edited by Vick Jr on Feb 13, 2009 at 06:01 PM


Ermac
Joined: Nov 24, 2006

Pops up from time to time


Posted: Feb 13, 2009 06:41 PM    Msg. 20 of 22       
Static scripts can be called over and over again. Dormant scripts are sleeping, and can only be called once.

I typed up the difference between them somewhere around here. I'll get it in a second.

EDIT: OK, here it is. I also have an example, courtesy of Me KS.

Quote: Static scripts can be used to set something up to be called from the main script (as they often are used in the original campaign scripts).

Dormant scripts are sleeping, and are not awakened until called from another script using the (wake [script name]) command. Dormant scripts can ONLY be awakened once. Once it is done, it is done.


Quote: And static scripts aren't as complicated as they seem. They're like self-made scripting commands. You can make your own command out of a static script's commands, so they're pretty useful. e.g:



(script static "void" replace_grunts
(ai_kill grunts)
(ai_place elites)
)

(script static "void" replace_elites
(ai_kill elites)
(ai_place grunts)
)



Whenever I want to replace the grunts with elites, instead of running two commands, I can just script in:

(replace_grunts)

And it will run the static script with no need for arguments or anything. Same for replacing elites with grunts:

(replace_elites)

Just as if the static scripts were commands.

And unlike dormants, statics can be run as many times as needed.


Also, I THINK (Not sure) that the (sleep -1) command is meant to stop the continuous scripts.
Edited by drillinstructor on Feb 13, 2009 at 06:52 PM


Vick Jr
Joined: Jun 26, 2008

Well enough alone...


Posted: Feb 14, 2009 02:05 PM    Msg. 21 of 22       
Yes, I think that (sleep -1) can act as a break statement.

OK, i figured out why my script wasn't working. It's because no matter what, it never recognizes that I'm looking at a flag.

I tried (objects_can_see_flag (players )floodarea 360) and it said false. How is that possible? I'm looking right at it!

I also tried it with
(objects_can_see_object (players )floodobject 360)
still false. WTF? How do you use this command?

Is what's the command to set a nav point on the flag named "floodarea" so i can see it in game?
Does it matter if it is an mp map?


Ermac
Joined: Nov 24, 2006

Pops up from time to time


Posted: Feb 14, 2009 03:55 PM    Msg. 22 of 22       
MP is strange when it comes to scripts. I couldn't get the AI to follow me in MP, but it worked perfectly in SP. Perhaps it doesn't even recognize the script.

The command to set a navpoint on a flag is this:

(activate_team_nav_point_flag [navpoint] [team] [cutscene_flag] [real])


For the navpoint option, any of these will work: default, default_red, flag_blue, flag_red, target_blue, target_red, skull_blue, skull_red, crown_blue, crown_red.

The rest is self-explanatory, but speak up if you have any questions.

EDIT: Forgot to close the code tag.
Edited by drillinstructor on Feb 14, 2009 at 03:56 PM

 

 
Previous Older Thread    Next newer Thread







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