[Resources] Script Library

This forum is for uploading new building blocks for maps such as tags and new models. Please do not post any copyrighted material (ie, models/textures from other games).
PyroBlizzard




Stylist Critic Trickster

Posts: 659
Joined: Thu Jun 30, 2005 4:49 pm
Location: AUZZIES RULE AT HALO 3!

Post by PyroBlizzard »

Code: Select all

(object_create objects\weapons\rifle\smg\smg.weap)
(weapon_hold_trigger objects\weapons\rifle\smg\smg.weap 0 true)
(sleep 500)
(weapon_hold_trigger objects\weapons\rifle\smg\smg.weap 0 false)
(object_destroy objects\weapons\rifle\smg\smg.weap)
Forgot time limit.

30 halo time = 1 sec i think
SOmething like that look in tutorial.

You can also put your own time there
Image
User avatar
LuxuriousMeat





Posts: 824
Joined: Thu Nov 03, 2005 6:43 pm
Location: zzzzzzzzzzzzzzzz
Contact:

Post by LuxuriousMeat »

i dont think you replace gun with the ident name im pretty sure you replace it with the local object name of the weapon
Image
PyroBlizzard




Stylist Critic Trickster

Posts: 659
Joined: Thu Jun 30, 2005 4:49 pm
Location: AUZZIES RULE AT HALO 3!

Post by PyroBlizzard »

Well how do we know local object?
Image
User avatar
LuxuriousMeat





Posts: 824
Joined: Thu Nov 03, 2005 6:43 pm
Location: zzzzzzzzzzzzzzzz
Contact:

Post by LuxuriousMeat »

there is a reflexive in the [scnr] called local objects and there is a string in the chunks called name which is the thing you would replace it with and there is a enum which references the placement reflexive like the vehicle, weapon, etc reflexive and then there is another value which references the chunk in the for example weapon placement reflexive and in that chunk it references to a chunk in the (for example) weapon pallet which references a weapon it sounds really complicated but tis easy once you get it
Image
PyroBlizzard




Stylist Critic Trickster

Posts: 659
Joined: Thu Jun 30, 2005 4:49 pm
Location: AUZZIES RULE AT HALO 3!

Post by PyroBlizzard »

Oh yeah i get what u mean
Image
User avatar
Munsie




Blacksmith

Posts: 1485
Joined: Mon Aug 29, 2005 11:07 am
Location: Canada

Post by Munsie »

PyroBlizzard wrote:30 halo time = 1 sec i think
SOmething like that look in tutorial.
Nope. Skayter's tutorial was off. Agent ME had them update it with the real conversion. Go check.

~Munsie
Soldier of Lite




Coagulator Pi Miner Wordewatician 50

Posts: 98
Joined: Tue Feb 21, 2006 7:39 pm

Post by Soldier of Lite »

OK, time for some explanations........
First, 30 frames is 1 second (aka 30 fps). You specify sleep time in frames.

Next, when spawning an object you reference it with a local object name. There is a reflexive, number 3, in the scnr tag, that contains a name for all scripted objects. Here's how the reflexive looks:

Code: Select all

struct local objects {
 string32 name
 enum16 type {
  0=bipd
  1=vehi
  2=weap
  6=scenery
  7=mach
  8=ctrl
 }
 index16 index
}
Basically, you give the object a name, and then reference the proper placement chunk with the 2 values. You've all seen the Vehicle Placement/Pallette reflexives, etc. This one reflexive points to all of those, based on the enum and index. So if I wanted to reference the first vehicle, I would give it a name "vehicle0" for example, then say its enum is 1 and its index is 0. The placement chunk references the pallette, and gives it coordinates, etc.

I really don't feel like writing another tutorial on how to use a program, but I'll continue to answer questions, so if someone wants to compile a FAQ guide go ahead.
Image
User avatar
ali954
Readers Club





Posts: 150
Joined: Mon Oct 11, 2004 1:20 pm
Location: VA
Contact:

Post by ali954 »

is there a way to push a button and have something happen and if u push it again it will increase or go back to the way it was?
Hawaiian Modder




Pi Connoisseur

Posts: 2154
Joined: Sat Nov 26, 2005 7:17 pm
Location: In a cave smokin up with tupac and big foot.

Post by Hawaiian Modder »

Is there a script where if your in a warthog and you press the horn, normal horn sound plays, but if you press the horn and the brake, it plays some other sound.
Image
Thanks lej for the sig.
Dr.Cox wrote:I like Cox.
Soldier of Lite




Coagulator Pi Miner Wordewatician 50

Posts: 98
Joined: Tue Feb 21, 2006 7:39 pm

Post by Soldier of Lite »

Ali, yes. Something like this:

Code: Select all

(sleep_until (= (device_group_get <button device group>) 1))
(rest of script here)
Hawaiian, no. There's probably some way to patch it together using 2 triggers.
Image
User avatar
Agent ME




Articulatist 500

Posts: 881
Joined: Tue Jun 21, 2005 6:00 pm
Location: California, USA
Contact:

Post by Agent ME »

PyroBlizzard wrote:

Code: Select all

(object_create objects\weapons\rifle\smg\smg.weap)
(weapon_hold_trigger objects\weapons\rifle\smg\smg.weap 0 true)
(sleep x)
(weapon_hold_trigger objects\weapons\rifle\smg\smg.weap 0 false)
(object_destroy objects\weapons\rifle\smg\smg.weap)
Im pretty sure u replace them with the weap name of the gun u want. Such as:
objects\weapons\rifle\smg\smg.weap
You have to reference a named script object.
TheTyckoMan wrote:This topic belongs in the tags and resources section. I will move it in or around 24 hours from now...actually I can't do that because I'll be at work....hmmm.... :?
I thought that section was only for HaloCE?

Even if it wasn't, no one interested in Halo2 modding is ever going to look in that section when they're looking for Halo2 stuff (unless they're drunk or something...). :P
Hawaiian Modder




Pi Connoisseur

Posts: 2154
Joined: Sat Nov 26, 2005 7:17 pm
Location: In a cave smokin up with tupac and big foot.

Post by Hawaiian Modder »

I go there, for models to import into halo 2.
Also got a new idea for a script.
How bout making the B button work on vehicles in mp?
Image
Thanks lej for the sig.
Dr.Cox wrote:I like Cox.
User avatar
Agent ME




Articulatist 500

Posts: 881
Joined: Tue Jun 21, 2005 6:00 pm
Location: California, USA
Contact:

Post by Agent ME »

I doubt there'd be a way to get that to work with scripts, except maybe a really cheap-hacky work-around that probably wouldn't be completely SLC, and probably be a bit buggy (Like player1 is in banshee - player2 hits B, banshee shoots bomb)
Soldier of Lite




Coagulator Pi Miner Wordewatician 50

Posts: 98
Joined: Tue Feb 21, 2006 7:39 pm

Post by Soldier of Lite »

Yeah, it can't be done with scripts. It might be possible with a trainer *cough*yelo*cough* but not with scripts.
Image
Hawaiian Modder




Pi Connoisseur

Posts: 2154
Joined: Sat Nov 26, 2005 7:17 pm
Location: In a cave smokin up with tupac and big foot.

Post by Hawaiian Modder »

Couldn't you do something like turks script where if you hold down B then the weapon works or something?
Idk I think it would be cool for my mod though.

Edit: New idea.
Make a script where it ends the game in multiplayer.
Image
Thanks lej for the sig.
Dr.Cox wrote:I like Cox.
User avatar
snakejknight




Trickster Wave Pyre Wordewatician 500

Posts: 693
Joined: Sun Jun 04, 2006 1:00 pm
Location: North Hollywood California

Post by snakejknight »

Ahhhhhhhhhh help!!! i'm tryign to make a weapon appear and fire for a while... but all that happens is it apears, and 500 units of time later the game freezes... this is wat i tried

Code: Select all

(script startup weapon 
  (begin 
   (sleep 500) 
   (object_create Script_Weapon) 
   (weapon_hold_trigger Script_Weapon 0 True) 
   (sleep 500) 
   (weapon_hold_trigger Script_Weapon 0 False)
  )
)
Hawaiian Modder wrote: Edit: New idea.
Make a script where it ends the game in multiplayer.
I did make one that restarted the game...

Code: Select all

(script continuous Game_Restart 
  (begin 
   (sleep 500) 
   (game_revert)
  )
)
-DeToX-




Illusionist Recreator Connoisseur Acolyte
Sigma Decryptor Droplet Pyre
Blacksmith Socialist New Age System Engineer
ONI

Posts: 4589
Joined: Sun Jun 18, 2006 3:58 pm
Location: ...

Post by -DeToX- »

Hawaiian Modder wrote:Edit: New idea.
Make a script where it ends the game in multiplayer.

Code: Select all

(script startup gameover_switch
 (begin 
   (sleep_until (> (device_group_get gate) 0)) 
   (begin 
     (game_won) 
     (print "GAME OVER SO GET LOW BUS")
  ) 
))
Ends the game when the switch is activated.
Image
User avatar
neodos
Readers Club




Artisan Miner

Posts: 1394
Joined: Thu Aug 12, 2004 11:57 am

Post by neodos »

Soldier of Lite wrote:OK, time for some explanations........
First, 30 frames is 1 second (aka 30 fps). You specify sleep time in frames.

Next, when spawning an objec

t you reference it with a local object name. There is a reflexive, number 3, in the scnr tag, that contains a name for all scripted objects. Here's how the reflexive looks:

Code: Select all

struct local objects {
 string32 name
 enum16 type {
  0=bipd
  1=vehi
  2=weap
  6=scenery
  7=mach
  8=ctrl
 }
 index16 index
}
Basically, you give the object a name, and then reference the proper placement chunk with the 2 values. You've all seen the Vehicle Placement/Pallette reflexives, etc. This one reflexive points to all of those, based on the enum and index. So if I wanted to reference the first vehicle, I would give it a name "vehicle0" for example, then say its enum is 1 and its index is 0. The placement chunk references the pallette, and gives it coordinates, etc.

I really don't feel like writing another tutorial on how to use a program, but I'll continue to answer questions, so if someone wants to compile a FAQ guide go ahead.
Can we add an objective on Local objects? or maybe is the objective already recognized as a Local object?
n64nerd




Articulatist 100

Posts: 127
Joined: Mon Dec 05, 2005 5:44 pm

Post by n64nerd »

can you find teams? can you tell which team or which player activated a switch? can you make one team win? how would you see if a switch spawned through the machine palette was pressed?
http://files.halomods.com/viewtopic.php?t=50904
my first tutorial in the tutorial section
User avatar
ali954
Readers Club





Posts: 150
Joined: Mon Oct 11, 2004 1:20 pm
Location: VA
Contact:

Post by ali954 »

is there a way to make a script start from the time u respawn?
Post Reply