Page 4 of 8

Posted: Sun Nov 05, 2006 12:00 am
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

Posted: Sun Nov 05, 2006 1:13 am
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

Posted: Sun Nov 05, 2006 1:19 am
by PyroBlizzard
Well how do we know local object?

Posted: Sun Nov 05, 2006 1:25 am
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

Posted: Sun Nov 05, 2006 1:54 am
by PyroBlizzard
Oh yeah i get what u mean

Posted: Sun Nov 05, 2006 6:42 am
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

Posted: Sun Nov 05, 2006 11:02 am
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.

Posted: Sun Nov 05, 2006 1:03 pm
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?

Posted: Sun Nov 05, 2006 2:25 pm
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.

Posted: Sun Nov 05, 2006 2:33 pm
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.

Posted: Sun Nov 05, 2006 5:15 pm
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

Posted: Sun Nov 05, 2006 6:01 pm
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?

Posted: Sun Nov 05, 2006 6:10 pm
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)

Posted: Sun Nov 05, 2006 6:14 pm
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.

Posted: Sun Nov 05, 2006 7:01 pm
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.

Posted: Sun Nov 05, 2006 7:24 pm
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)
  )
)

Posted: Sun Nov 05, 2006 7:46 pm
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.

Posted: Sun Nov 05, 2006 10:12 pm
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?

Posted: Mon Nov 06, 2006 7:32 am
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?

Posted: Mon Nov 06, 2006 9:07 am
by ali954
is there a way to make a script start from the time u respawn?