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 »Scripting Thread

Page 2 of 7 Go to page: · 1 · [2] · 3 · 4 · 5 · 6 · 7 · Prev · Next
Author Topic: Scripting Thread (231 messages, Page 2 of 7)
Moderators: Dennis

bourrin33
Joined: Oct 19, 2009

HEK not installed tho


Posted: Sep 9, 2012 04:09 PM    Msg. 36 of 231       
neat idea


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 9, 2012 05:45 PM    Msg. 37 of 231       
Oh...My...Gosh...I know no one will believe me, but i just thought of a way to detect if the player is crouching. It might require some animation work, but all you'd need to do is add a marker attached to the pelvic bone and name it crouch. Now in-game add three bipeds and two encounters and name them. I'll name them "ai1" "ai2" "test" and the encounters "crouch1" and "crouch2" for this example. Now make a script like this
(script static void boom
(effect_new_on_object_marker "vehicles\scorpion\shell explosion" (unit (list_get (players) 0)) "body")
(sleep 150)
)
(script continuous ai_attach
(ai_attach ai1 crouch1)
(ai_attach ai2 crouch2)
(ai_look_at_object ai1 ai2)
(ai_look_at_object ai2 ai1)
(objects_attach (unit (list_get (players) 0)) "crouch" test "body")
(objects_attach (unit (list_get (players) 0)) "left foot" ai1 "body")
(objects_attach (unit (list_get (players) 0)) "right foot" ai2 "body")
(if (objects_can_see_object (ai_actors crouch1) test 45)
(if (objects_can_see_object (ai_actors crouch2) test 45)
(boom))
))
)
Keep in mind this is untested, and i typed this script quickly. So if there're mistakes, don't blame me. Lol. So, Kirby, what do you think? Will it work? like i said, it might need animation work.

EDIT:Oh, should'v clarified: The crouch marker would be attached to the pelvic bone, but positioned in a way that it wouldn't move between the feet markers until the crouch animations were played.
Edited by grunt_eater on Sep 9, 2012 at 05:56 PM


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 9, 2012 05:50 PM    Msg. 38 of 231       
it works fine, I already do it with OS and the objects_distance_to_object. It'll take a lot of tweaking if you want to do it with AI, but it'll work when you get everything aligned correctly. I attach an item to the pelvis and check its distance from the player (since it goes from the objects 0,0,0 meaning that it will get closer when he crouches)


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 9, 2012 06:07 PM    Msg. 39 of 231       
Yeah, but i have to do everything no OS...Lame computer. Lol. But i am shocked that everyone says this is impossible, and how many things everybody says are impossible. I am still, however, trying to figure out how to make this third person thing...So i know that when you select your color in the UI menu, it stores it somewhere. Would it be possible to access this data with script commands? And without making a custom UI that when people select their color it stores it internally in the game...And without OS... Hmmmm. Would it be possible to make it so that when people join, they have to select their color(permutation of their biped) only once and then it's stored? and then use that stored information to set another bipeds permutation and load the player into that biped?
Edited by grunt_eater on Sep 9, 2012 at 06:08 PM


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 9, 2012 06:34 PM    Msg. 40 of 231       
If you want other people to see your information, you'd have to broadcast it. Anyways, regardless of whether its for local or online, how are you going to determine who is who? Weren't you the one displeased with my huge script where it asked them who they where? There is another sort of way you could try to identify the local player, which is based around continuing through respawn, but multiple people dying at once breaks it. Assign every player to a global variable. When one of the variables dies, reset the variable to the next player that spawns. The variables wouldn't shift like the object_list, so you'd have solid ideas of whose who until the death factor comes in.

It would be easier with team games, where its just red or blue. Spawn them in a box with an AI. Have the AI allied to one of the two teams, if the ai_status returns that they are aware of an enemy, then you know the player is the other team.


nihao123456ftw
Joined: Mar 24, 2012


Posted: Sep 9, 2012 10:26 PM    Msg. 41 of 231       
Quote: --- Original message by: killzone64
Quote: Ultimate CTF Plan

<a href="http://video.xfire.com/58798a-4.jpg" target="_blank">http://video.xfire.com/58798a-4.jpg</a>

More of just a command you can type ingame


  • Open any scenario and place a rock scenery or any named object, even a vehicle would work

  • give that rock a name




XD i like that idea i may just use that as an easteregg, any way to script that so it works when you grab a powerup?


My friend Taiwan123 came up with a better way to sync this on multiplayer i think...

in guerilla make a new .weapon tag

fill the gbxmodel field with the .gbxmodel from the rock scenery, save.

make an item_collection tag, set weight to 100 and save

then you can place this like a weapon in the map, it will look like any normal ordinary rock but you will clip through it and then you can hold e to pick it up like a normal weapon and will cover the entire player


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 12, 2012 11:34 PM    Msg. 42 of 231       
Hey, Kirby, what command do i use to check if a unit is dead?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 12, 2012 11:47 PM    Msg. 43 of 231       
(unit_get_health <unit>)
-1 : Doesn't exist in any form (no corpse, etc)
0 : dead
1 : full health
Between 0 and 1, between full health and dead lol. (0.5 would be half, 0.75 would be 75%, etc)


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 13, 2012 12:49 AM    Msg. 44 of 231       
So if i were to make a script like this
(script continuous dead
(sleep_until (unit_get_health (unit (list_get (players) 0))) 0)
(unit_set_current_vitality (unit (list_get (players) 0)) 1 1)
)
Why wouldn't it work in-game? it compiles correctly. But in-game when i die, it doesn't set me to being alive again. Even when i open console and type the command in on a test biped. Setting it to 0 works, but not 1. Why is this?
Edited by grunt_eater on Sep 13, 2012 at 01:06 AM


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 13, 2012 11:45 AM    Msg. 45 of 231       
When something is dead, its dead. Also, you don't even check for the condition that they are dead. the number in sleep_until is the number of ticks between checks, not the condition you are waiting for. Besides, after a player dies, they are removed from the (players) object_list, so you couldn't even reference their corpse like that. The moment they're dead, they wouldn't even be able to do the unit_get_health like that either. Also, unless you modified your biped's collision to only have 1 health and 1 shield, your options in set vitality are gonna give you 1/75th health, 1/75th shield. Instead, make the player deathless, and check for some tiny little number.

(script startup setup
(set cheat_deathless_players 1)
)
(script continuous refill_health
(sleep_until (< (unit_get_health (unit (list_get (players) 0))) 0.00001) 5)
(unit_set_current_vitality (unit (list_get (players) 0)) 75 75)
)


Anyways, if you want a hook to a player that keeps on going even when they are dead,
(global unit player0 none)
(script startup hooking
(sleep 15) ;;however long you think it'll take for em to spawn
(set player0 (unit (list_get (players) 0)))
)

now you'll be able to use player0 to get their body, even if they die or bump possess something else.


Also, if you're wondering, you can use the set vitality to exploit online. Set your own health to 0, you'll fall down as a dead corpse.. however... your controls are still connected to the biped; the (players) object_list hasnt rejected you because you didnt correctly die. You may now flail around as a corpse murdering people. Since your already dead, you cant be killed. Hop into a vehicle, go on a rampage. After like 30 seconds of the game not knowing what happened to you, it'll respawn you without giving you any death count (I think its when your corpse despawns) I have lots of these sorts of exploits saved up lol; Trapping people in your server, cloning servers in the server list, breaking clients controls, preventing clients from spawning (they are in the server, but they arent in the player list or anything)


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 13, 2012 05:18 PM    Msg. 46 of 231       
O_O Locking players into your server. I want that one, so that i can have a control room that allows me to trap them and make them dance like puppets >:D Mwahahahahah. Anyway, so if i did this
(global unit player0 none)
(script startup hooking
(sleep 15) ;;however long you think it'll take for em to spawn
(set player0 (unit (list_get (players) 0)))
)
It would make it so that i could control the dead body of the player. I think i'm gonna PM you what this is for, so i might be able to get some help without people knowing what i'm doing 'till it's already done. Lol. I'm secretive...So what?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 13, 2012 06:02 PM    Msg. 47 of 231       
control it, as in teleport it, scale it, object_destroy, etc. script control it, not player control.

Anyways, most of the other exploits I mentioned work off of core_save and core_load (I really shouldn't be telling people how to break the game for others, but eh, whatever) Removing someone's control is a core_save, kill everyone, core_load. they can't control their biped. After someone quits, core_load back to when they where still around, keep their CD hash there for a while. etc. believe it was game_lost that I used to create fake servers in the list, they seem to last anywhere from an hour to 5 minutes.


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 13, 2012 06:09 PM    Msg. 48 of 231       
Yeah, that's what i meant by control. Lol. And fun toys :D. Hey, i thought of something. Has anyone ever been in one of those servers that has a biped named server that isn't an actual player? But when you kill them you get points. I was wondering how i would go about making one of those?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 13, 2012 06:14 PM    Msg. 49 of 231       
core_save'ing in your server with players allows you to core_load those players where ever. you could head over to lan, and continue murdering those players as long as you want.


creator843
Joined: Jul 10, 2012

I LOVE HALO!


Posted: Sep 13, 2012 06:18 PM    Msg. 50 of 231       
how do i make a pelican able to lift a vehicle?¿ some script?


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 13, 2012 06:25 PM    Msg. 51 of 231       
people already responded to you in another thread lol.

Anyways, there is the list of things to ask, are you doing it with or without OS. If you are doing it without OS, are you doing it easily, or would you rather pick up anywhere. If you're doing it with OS, we'll just do it as a pickup anywhere.

With OS, http://www.mediafire.com/?gweabv5hafhhv Grab the newest version of hscworkshop there, go into the template folder, grab the OS.pickupvehicles.hsc_template

If you're doing it without OS, you have to decide whether you're using trigger volumes for just picking up at set places, or, AI to pickup anywhere. Anyways, I'm in class, I don't have much resources with me, respond what you're looking for, and ill get back to you sometime later (or, you can look at what people answered you in the vehicle thread, since they gave you a non-OS solution with trigger volumes)


forrestkeller1
Joined: Nov 3, 2007

What? Why am I still here?


Posted: Sep 13, 2012 08:35 PM    Msg. 52 of 231       
I need your help on this one Kirby on my remake of B30, I'm getting some odd scirpt related errors I believe but on the first part, the music does not stop, I know it's called by this in the script (set play_music_b30_01 false ) but it seems to ignore it.

If you need I could throw you a copy of the script on Xfire


Edited by forrestkeller1 on Sep 13, 2012 at 11:02 PM


game user10
Joined: Dec 9, 2011

Who is the Overseer?


Posted: Sep 15, 2012 07:36 AM    Msg. 53 of 231       
Okay so my teleport script thing could work.

(script continuous player1teleporter1a
(if
(and (volume_test_objects "Teleporter1a" (ai_actors "Player1/Player1")) ((>= real_random_range 0 1) 0.5)
(ai_command_list Player1 Teleporter1a)
)


Now how do I make it so that they won't spam the teleporters?


creator843
Joined: Jul 10, 2012

I LOVE HALO!


Posted: Sep 15, 2012 08:21 AM    Msg. 54 of 231       
Quote: --- Original message by: kirby_422
core_save'ing in your server with players allows you to core_load those players where ever. you could head over to lan, and continue murdering those players as long as you want.

oh...noooo.....


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 15, 2012 11:53 AM    Msg. 55 of 231       
Hey, are you the good creator who asked about making players AI, or the bad one who PM'd me that it was a bad idea and asked me to remove it, or the good one again that told me about the bad one that asked me to remove it not being the good one? 0_0


creator843
Joined: Jul 10, 2012

I LOVE HALO!


Posted: Sep 15, 2012 02:42 PM    Msg. 56 of 231       
Quote: --- Original message by: grunt_eater
Hey, are you the good creator who asked about making players AI, or the bad one who PM'd me that it was a bad idea and asked me to remove it, or the good one again that told me about the bad one that asked me to remove it not being the good one? 0_0

WHAT?¿?¿?¿!!?¿ incidentally was my cousin .. he was trying to find a way to get kills without having to fight with players that way he could get all the medals of optics. and i think im good i dont know ... People will say .. wanna be my friend? : D
Edited by creator843 on Sep 15, 2012 at 02:44 PM


creator843
Joined: Jul 10, 2012

I LOVE HALO!


Posted: Sep 15, 2012 07:46 PM    Msg. 57 of 231       
Quote: I somehow knew this was the reason -_-

wanna be my friend? :D


creator843
Joined: Jul 10, 2012

I LOVE HALO!


Posted: Sep 16, 2012 08:01 AM    Msg. 58 of 231       
Quote: --- Original message by: aLTis
Quote: --- Original message by: creator843
Quote: I somehow knew this was the reason -_-

wanna be my friend? :D

I hate you, sorry.

why?¿ ._. back on topic thanks kirby for the help :D xD
Edited by creator843 on Sep 16, 2012 at 08:03 AM


creator843
Joined: Jul 10, 2012

I LOVE HALO!


Posted: Sep 16, 2012 02:34 PM    Msg. 59 of 231       
Quote: --- Original message by: aLTis
Quote: --- Original message by: creator843

Quote: --- Original message by: aLTis
Quote: --- Original message by: creator843
Quote: I somehow knew this was the reason -_-

wanna be my friend? :D

I hate you, sorry.

why?¿ ._. back on topic thanks kirby for the help :D xD
Edited by creator843 on Sep 16, 2012 at 08:03 AM

for example http://hce.halomaps.org/index.cfm?fid=6369

what?¿ credits?¿ dude i just change texture and place some weapons and vehicles,john make the readme not me Lol he is on halomaps so dont rage at me.


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 16, 2012 04:33 PM    Msg. 60 of 231       
Quote: --- Original message by: game user10
Okay so my teleport script thing could work.

(script continuous player1teleporter1a
(if
(and (volume_test_objects "Teleporter1a" (ai_actors "Player1/Player1")) ((>= real_random_range 0 1) 0.5)
(ai_command_list Player1 Teleporter1a)
)


Now how do I make it so that they won't spam the teleporters?

Are these AI, or players? If they are AI, why are they named 'player1' and such? If they are players, why are you using encounter stuff to do it?

(global short enc1_num 0)
(script static unit enc1_unit (unit (list_get (ai_actors ENCOUNTER1) enc1_num)))
(script continuous teleporter
(if (volume_test_object TRIGG_1 (enc1_unit)) (begin
(object_teleport (enc1_unit) FLAG_1)
(sleep_until (not (volume_test_object TRIGG_2 (enc1_unit))) 5)
))
(if (volume_test_object TRIGG_2 (enc1_unit)) (begin
(object_teleport (enc1_unit) FLAG_2)
(sleep_until (not (volume_test_object TRIGG_1 (enc1_unit))) 5)
))
(if (< enc1_num (list_count (ai_actors ENCOUNTER1))) (set enc1_num (+ enc1_num 1)) (set enc1_num 0))
)




Also, something easier than the local player "follow the flashlight patterns", just ask them who their local player is basically.
(global unit local_player none)
(global short local_player_number -1)
(global short number 0)
(script static unit player (unit (list_get (players) number)))

(script static void detect
(if (and (!= (unit_get_health (player)) -1) (= local_player none) (= (unit_get_current_flashlight_state (player)) 0)) (begin
(cinematic_set_title instruction_title) ;; "Is this your character? Press flashlight if so" 1 second.
(camera_set_dead (player))
(sleep 30)
(if (unit_get_current_flashlight_state (player)) (begin
(set local_player (player)) (set local_player_number number)
))
))
)

(script dormant detect_local_player
(set local_player none)
(set local_player_number -1)
(camera_control 1)
(set number 0)
(detect)
(set number 1)
(detect)
(set number 2)
(detect)
(set number 3)
(detect)
(set number 4)
(detect)
(set number 5)
(detect)
(set number 6)
(detect)
(set number 7)
(detect)
(set number 8)
(detect)
(set number 9)
(detect)
(set number 10)
(detect)
(set number 11)
(detect)
(set number 12)
(detect)
(set number 13)
(detect)
(set number 14)
(detect)
(set number 15)
(detect)
(camera_control 0)
)

The local number global is a bit pointless since it wont be correct for very long, but its there if you want it.


grunt_eater
Joined: Jan 26, 2011

Everything except biped rigging.


Posted: Sep 16, 2012 06:10 PM    Msg. 61 of 231       
Hey, Kirby, a question. Do you know if the player list changes when someone enters? I mean, does it bump the first person down a number, does it bump them down depending on the score? Just curious weather or not you knew.


game user10
Joined: Dec 9, 2011

Who is the Overseer?


Posted: Sep 16, 2012 09:30 PM    Msg. 62 of 231       
They are AI, and named as such because I imitated a six-man Slayer free-for-all match.


Hobbet360
Joined: Jan 10, 2012

ProTools > ToolPro


Posted: Sep 17, 2012 03:16 AM    Msg. 63 of 231       
Hello, how do I add nav points, I have looks nearly everywhere but I can't find any examples, just the names of thing to type (activate_nav_point_flag <navpoint> <unit> <Cutscenes flag> <real>). But what is <navpoint> and I know what <unit> means but what is it needed for in a nav point?


game user10
Joined: Dec 9, 2011

Who is the Overseer?


Posted: Sep 17, 2012 07:38 AM    Msg. 64 of 231       
I think it's the type of navpoint, try typing in "default".


afD2345
Joined: Apr 2, 2011


Posted: Sep 17, 2012 09:38 AM    Msg. 65 of 231       
Quote: --- Original message by: game user10
I think it's the type of navpoint, try typing in "default".

if you type "default", when it(game[script]) is asking for <unit>, it(the game) will try to find unit called "default", and if it doesn't find that unit it will crash*. if you type "none", it(the game) will not try to find any unit.
edit1: *(if you somehow force sapien to compile that script)

Edited by afD2345 on Sep 17, 2012 at 09:40 AM


Hobbet360
Joined: Jan 10, 2012

ProTools > ToolPro


Posted: Sep 18, 2012 09:46 PM    Msg. 66 of 231       
Quote: --- Original message by: afD2345

Quote: --- Original message by: game user10
I think it's the type of navpoint, try typing in "default".

if you type "default", when it(game[script]) is asking for <unit>, it(the game) will try to find unit called "default", and if it doesn't find that unit it will crash*. if you type "none", it(the game) will not try to find any unit.
edit1: *(if you somehow force sapien to compile that script)

Edited by afD2345 on Sep 17, 2012 at 09:40 AM


Doesn't work. "none" as the unit works though

EDIT: -erm, Nevermind about that ^^ I just found this on modacity by P0lar_bear:

Quote:
Meh. Same difference. Via scripts, there are four ways to set a navpoint (the engine refers to them as waypoints), and those are by attaching the waypoint to either a cutscene flag or an object, and have it visible to either one unit, or a team. To set a waypoint, use
(activate_nav_point_flag) or (activate_team_nav_point_flag) to attach the
waypoint to a cutscene flag, and use (activate_nav_point_object)
(activate_team_nav_point_object) to attach a waypoint to a named
object. When done with a waypoint, use a (deactivate_nav_point') or
(deactivate_team_nav_point') to turn it off. Since I don't know how to
refer to the players as units, I usually set a team waypoint. The full
syntax of a team waypoint command is
(activate_team_nav_point_flag/object <waypoint type> <team>
<flag/object> <vertical offset>).

<waypoint type> can be, by default, 'default', 'default_red', 'flag_blue', 'flag_red', 'target_blue', 'target_red', 'skull_blue', 'skull_red', 'crown_blue', and 'crown_red'. Singleplayer maps should use only the default, and maybe, if you have to kill a certain enemy, the target nav points. the 'default' type and red types of waypoints should be used on urgent things, like the exit on an area that would ahve a timed escape, or an enemy that is about to own you.

<team> should always be set to 'player', if you want the player to see the waypoint!

<flag/object> is what you are attatching the waypoint to, which depends on the type of command you're using. Simply put in the name of the desired object or flag you wish to attach the waypoint to.

<vertical offset> is how much higher on the z-axis the waypoint is placed from the object or flag's marker in sapien. If you attach it to something on the ground, like a door, biped, or weapon, make sure to set it to about .6 or higher, but if its something like a picture on a wall, or if the flag/object is otherwise not on the ground, set it to 0.

(deactivate_team_nav_point_flag/object) is a bit different. The syntax for it is (deactivate_team_nav_point_flag/object <team> <object/flag>), where <team> is what team you wish to not see the navpoint anymore, and <object/flag> is the object or flag the navpoint is attached to.

So, let's say we wanted to set a normal waypoint at a position we want the player to go to. Lay down a cutscene flag, name it nav_1, then add a script in your map that has this command: (activate_team_nav_point_flag default 'player' nav_1 .6)

Now for something a little more useful. Let's make it so we put a waypoint on a warthog, and it turns off whenever the player is in the driver seat,
and turns on if the player is ejected. Place a warthog and name it
drive_me. Now, make and compile this script:

(script continuous hog_checker (if (vehicle_test_seat_list drive_me 'w-
driver' (players)) (deactivate_team_nav_point_object 'player' drive_me)
(activate_team_nav_point_object 'default_red' 'player' drive_me 1)) )

In theory, that will constantly deactivate the waypoint while a player is in
the driver seat, and then constantly activate it when there is no player in
the driver seat. I don't know if more than one waypoint can be put on the
same object or flag, but if it doesn't, then this should work fine.

Anyway, read up hs_doc, or the HS Bible, and find out more ways on how
to make and use waypoints effectively.


EDIT 2: BTW I found that here: http://www.modacity.net/forums/showthread.php?18957-The-Ultimate-Halo-CE-Tutorial-Index
Edited by hobbet360 on Sep 18, 2012 at 11:24 PM
Edited by hobbet360 on Sep 18, 2012 at 11:27 PM


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 20, 2012 04:52 PM    Msg. 67 of 231       
If anyones ever wanted forloops and whileloops, you should look at sleep_until; it works exactly the way you'd expect it to
(global short for 0)
(script continuous forloop_example
(sleep 300)
(sv_say "begin!")
(sleep_until (begin (sv_say "A") (set for (+ for 1)) (> for 50)) (begin (sv_say "B") (set for 0) (+ 15 0)) )
(sv_say "COMPLETE!")
)

it'll state begin!, then b, then a 50 times, complete, then wait 10 seconds, begin, b, then 50 a's, complete. This example doesn't really use it efficiently, but I can't think of many places it would be that useful other than some coop map, loading players one at a time into a pelican with using only one minimal script, rather than multiple scripts or duplicated lines.
eg,
(global short forloop 0)
(script static unit player (unit (list_get (players) forloop)))
(script startup coop_mission_insertion
(cinematic_start)
(sleep 160)
(sv_say "blah blah blah")
(sleep 60)
(sv_say "Cortana: Blah blah blah")
;;for(int i=0;i<15;i++) {CONTENTS}
(sleep_until ;;FOR
(begin
(vehicle_load_magic insertion_pelican "" (player)) ;;CONTENTS
(set forloop (+ forloop 1)) ;;i++
(not (< forloop 15)) ;;i<15
)
(begin
(set forloop 0) ;;i=0
(+ 0 60)
)
)
(recording_play_and_hover insertion_pelican insertion_RA)
(sleep (+ (recording_time insertion_pelican) 30))
;;While(Condition) {Contents}
(sleep_until ;;WHILE
(begin
(unit_exit_vehicle (unit (list_get (players) 0))) ;;CONTENTS
(not (vehicle_test_seat_list insertion_pelican "" (players))) ;;CONDITION
)
30
)
(vehicle_hover insertion_pelican false)
(recording_play_and_delete insertion_pelican pelican_flyaway_RA)
(cinematic_stop)
)

*shrug* If you ever need it though, its there.


The boolean is for the inner workings, and basically anything that repeats. the short is used to preform any setup (so, for the for loops, initialize the values correctly before running the loop)


nihao123456ftw
Joined: Mar 24, 2012


Posted: Sep 20, 2012 07:36 PM    Msg. 68 of 231       
I made a killzone script while I was bored in class (only works for one player atm). I'm still in class so I only did a quick test of this script and it worked then, but it's supposed to do this:

If a player enters the trigger zone then he will be continuously damaged until he dies. To prevent cheating you'll be forced to be killed through scripts after 10 seconds anyway.

To set this script up:


  • Add a trigger volume in the areas that you don't want players to go into and give it a name

  • In the following script, copy the name that you gave the trigger volume you placed in the {trigger volume name} fields (remove the {}'s as well)




(global short time 0)

(script continuous outbounds_time
(sleep_until (= (volume_test_object {trigger volume name} (unit (list_get (players) 0))) true) 1)
(damage_object "weapons\assault rifle\bullet" (unit (list_get (players) 0)))
(set time (+ time 1))
(if
(= time 10)
(unit_kill (unit (list_get (players) 0)))
)
(sleep 30)
)

(script continuous inbounds_time
(sleep_until
(= (volume_test_object {trigger volume name} (unit (list_get (players) 0))) false)
1)
(if (> time 0)
(set time (- time 1))
)
(sleep 30)
)


game user10
Joined: Dec 9, 2011

Who is the Overseer?


Posted: Sep 24, 2012 03:16 AM    Msg. 69 of 231       
Teleport script does not seem to work.
(script continuous player1teleporter1
(if (volume_test_object Teleporter1a (enc1_unit)) (begin
(ai_command_list Player1 Teleporter1a)
(sleep_until (not (volume_test_object Teleporter1b (enc1_unit))) 5)
))
(if (volume_test_object Teleporter1b (enc1_unit)) (begin
(ai_command_list Player1 Teleporter1b)
(sleep_until (not (volume_test_object Teleporter1a (enc1_unit))) 5)
))
(if (< enc1_num (list_count (ai_actors Player1))) (set enc1_num (+ enc1_num 1)) (set enc1_num 0))
)


kirby_422
Joined: Jan 22, 2006

Apparently public enemy number 1?


Posted: Sep 24, 2012 08:35 AM    Msg. 70 of 231       
Quote: --- Original message by: game user10
Teleport script does not seem to work.
(script continuous player1teleporter1
(if (volume_test_object Teleporter1a (enc1_unit)) (begin
(ai_command_list Player1 Teleporter1a)
(sleep_until (not (volume_test_object Teleporter1b (enc1_unit))) 5)
))
(if (volume_test_object Teleporter1b (enc1_unit)) (begin
(ai_command_list Player1 Teleporter1b)
(sleep_until (not (volume_test_object Teleporter1a (enc1_unit))) 5)
))
(if (< enc1_num (list_count (ai_actors Player1))) (set enc1_num (+ enc1_num 1)) (set enc1_num 0))
)

if you are showing exactly what you're using, then of course it wont work. You completely got rid of the static script, enc1_unit, and the global variable, enc1_num. Also, why in the world are you using a command list? isnt this meant to be a teleporter? why did you replace all the object_teleport commands I had in there? And why are you applying the command list on the whole encounter?

 
Page 2 of 7 Go to page: · 1 · [2] · 3 · 4 · 5 · 6 · 7 · Prev · Next

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 4:10 AM 172 ms.
A Halo Maps Website