[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).
Post Reply
-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: ...

[Resources] Script Library

Post by -DeToX- »

Well I don't think anyone has done this yet, but to help some people out, I made this topic. Basically what you will do is post any scripts that you may find useful (Big Scripts, Small Useful ones), That everyone will be able to use pubically for their mods(As long as they give credit). So Instead of having scripts in many topics split all over, post any scripts here so that other users may learn from them or them.

These are resources for the Halo 2 Engine. Therefore in my opinion, should be kept.

This Topic May Be Used For:
-Script Posting
-Getting Scripts
-Requesting Scripts
-Script Help(We may fix your scripts.)
I'll start the topic with a simple script.

Random Gravity(Changes randomly in game):

Code: Select all

(script continuous random_gravity 
  (begin 
   (physics_set_gravity 0.5) 
   (sleep (random_range 900 1800)) 
    (begin 
     (begin_random 
      (begin 
       (print "stopping") 
       (physics_set_gravity 1 (random_range 10 20)) 
       (sleep (random_range 900 1800)) 
       (print "restarting") 
       (physics_set_gravity 0.5 (random_range 10 20)) 
       (sleep (random_range 900 1800))
      ) 
       (begin 
        (print "light grav") 
        (physics_set_gravity 0.8 (random_range 10 20)) 
        (sleep (random_range 900 1800))
       ) 
        (begin 
         (print "light grav") 
         (physics_set_gravity 0.1 (random_range 10 20)) 
         (sleep (random_range 900 1800))
        ) 
         (begin 
          (print "heavy grav") 
          (physics_set_gravity 2 (random_range 10 20)) 
          (sleep (random_range 900 1200)) 
          (physics_set_gravity 0.4 (random_range 10 20)) 
          (sleep (random_range 900 1200))
         )
        )
       )
      )
)
In Order to make the above script work, replace your db.txt(In your ScriptTools folder with this one.
Everyone Else post yours to help the community.

Also... Post Saying...
<Name>
<Description>
<How To Use(If Needed)>
<Script>

That way it is organized.
Last edited by -DeToX- on Sat Nov 04, 2006 7:05 am, edited 4 times in total.
Image
User avatar
foxfanatic23I7




Stylist Advisor Coroner Connoisseur

Posts: 1343
Joined: Mon Jul 24, 2006 1:38 pm
Location: Canada bishes
Contact:

Post by foxfanatic23I7 »

Awsome idea for the scripts libary, and a GREAT way to start off the libary as well :)
Image
User avatar
CptnNsan0




Stylist Snitch! Collaborator Commentator

Posts: 1904
Joined: Thu Jun 15, 2006 5:49 am
Location: Durham, NC

Post by CptnNsan0 »

Im just getting into scripting so give me soem time and i will post my first one
Image
Not Removing This
User avatar
Agent ME




Articulatist 500

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

Post by Agent ME »

AI Respawn script. Make sure to put the name of your ai squad replacing 'aisquad'

Code: Select all

(script continuous aisquad_respawn
  (begin
    (sleep_until (<= (ai_living_count aisquad) 0))
    (sleep (* 5 30))
    (ai_place aisquad)
  )
)
You can replace the 5 in there with how many seconds you want the game to wait before respawning the squad.
-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- »

Great thanks for contributing. :)
Image
Soldier of Lite




Coagulator Pi Miner Wordewatician 50

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

Post by Soldier of Lite »

Great idea. Here's an interesting one for you guys to play with:

Code: Select all

(object_create gun)
(weapon_hold_trigger gun 0 true)
(sleep x)
(weapon_hold_trigger gun 0 false)
(object_destroy gun)
Makes an instance of the script object "gun" and fires it for x seconds, then deletes it. This is how the SP scarab guns work.

Also, all of these scripts can be compiled using my new program ScriptTools ;).
Last edited by Soldier of Lite on Fri Nov 03, 2006 7:19 pm, edited 2 times in total.
Image
User avatar
foxfanatic23I7




Stylist Advisor Coroner Connoisseur

Posts: 1343
Joined: Mon Jul 24, 2006 1:38 pm
Location: Canada bishes
Contact:

Post by foxfanatic23I7 »

Thats so cool sol, thanks for that one!
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 »

Too bad that wouldn't sync up right in system link - as far as I can tell from my tests, local object weapons don't appear to the clients unless its in someone's hands, and they disappear after a while like a gun that was moved.
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 »

hey detox, not sure wats up but whenever i try to use ur script i get an error :(
-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- »

My bad... My database was being gay for that script... If you want to compile that one... Ill upload my database for you to use...(Replace your current db.txt with this one:
Attachments
db.rar
(4.83 KiB) Downloaded 108 times
Image
User avatar
latinomodder





Posts: 1040
Joined: Tue Sep 20, 2005 5:51 pm
Location: Costa Rica

Post by latinomodder »

Code: Select all

(script continuous Sputnik
  (begin
   
(sleep_until unit_has_weapon objects\weapons\multiplayer\ball\head_sp.weapon) )

(physics_set_gravity 0.5)

(print "Sputnik") 
)
I don't know but it should work if you bring over the SP head. This is done to recreate sputnik.
Last edited by latinomodder on Fri Nov 03, 2006 7:38 pm, edited 2 times in total.
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 »

That script won't work at all. Look at this part:

Code: Select all

(unit_has_weapon objects\weapons\multiplayer\ball\head_sp.weapon)
unit_has_weapon takes more than one parameter.

MP maps don't have "objects\weapons\multiplayer\ball\head_sp.weapon" in them, so you'll need to use "objects\weapons\multiplayer\ball\head.weap"

And it's a bit redundant - why did you bother with the or in there?
User avatar
latinomodder





Posts: 1040
Joined: Tue Sep 20, 2005 5:51 pm
Location: Costa Rica

Post by latinomodder »

I know you need the SP head I mentioned it in the post. Fixed it up a little sorry I had in in a txt document and just copied over
Image
Soldier of Lite




Coagulator Pi Miner Wordewatician 50

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

Post by Soldier of Lite »

That also won't work because you're missing the unit to check for the weapon.
Image
-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- »

Fixed Latinomodders script:

Code: Select all

(script continuous Sputnik
  (begin
(sleep_until (unit_has_weapon <scriptunit> objects\weapons\multiplayer\ball\ball.weap) (unit_has_weapon <scriptunit>  objects\weapons\multiplayer\ball\ball.weap) 1)
(physics_set_gravity 0.5)
(print "Sputnik")
  )
)
It will Set the gravity as 0.5 when the oddball is picked up. Where it says <scriptunit> you replace it with your actual script unit
Image
PyroBlizzard




Stylist Critic Trickster

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

Post by PyroBlizzard »

Just for an idea MB you could have an archive in first post of what scripts are in here.
Image
-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- »

PyroBlizzard wrote:Just for an idea MB you could have an archive in first post of what scripts are in here.
But i just posted the topic and I got some scripts, eventually It will grow too much it people keep posting.
Image
Loonycgb2





Posts: 233
Joined: Wed Jun 21, 2006 6:46 am
Location: HoUsToN
Contact:

Post by Loonycgb2 »

woh it works really good my scripts r working
-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- »

Code: Select all

(script continuous teleporter
 (begin
  (object_teleport (list_get (volume_return_objects <trigger_volume>) 0) <cutscene_flag>)
 )
)
SoL: ta da
SoL: it will teleport any object that goes into the zone :roll:
Image
PyroBlizzard




Stylist Critic Trickster

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

Post by PyroBlizzard »

-DeToX- wrote:

Code: Select all

(script continuous teleporter
 (begin
  (object_teleport (list_get (volume_return_objects <trigger_volume>) 0) <cutscene_flag>)
 )
)
SoL: ta da
SoL: it will teleport any object that goes into the zone :roll:
So could u make that so if i went a certain area in a MP level say..(foundation room1) it would teleport me to the center of the map?
Image
Post Reply