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 »Complex script order

Author Topic: Complex script order (33 messages, Page 1 of 1)
Moderators: Dennis

wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 14, 2009 05:51 PM    Msg. 1 of 33       
Hey

I want to know if and how I can make: Using first trigger volume; create a new object (vehicle); then use this vehicle; if that's happend create a new trigger volume; if this is used create a new weapon.

Is this possible? When yes what should I type?

Thx for help


yukonmuffin
Joined: May 10, 2007

Breakn' Stuff to look tough.


Posted: Apr 17, 2009 02:45 AM    Msg. 2 of 33       
There's no point. Just pre-do all the tirgger volumes and make a line at the end of your script to activate the next one, so the trigger volume that is used to make the weapon isn't active until you've gotten in the vehicle.


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 17, 2009 10:02 AM    Msg. 3 of 33       
But I don't know how to write it with the vehicle and i don't know what to write in the last line of the script. I need some example please.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 17, 2009 01:58 PM    Msg. 4 of 33       
You want to have it so that when you enter a trigger volume, a vehicle appears, and then if you enter another trigger volume AFTER the vehicle is made, a weapon appears?

Replace [vehicle] with the name of the vehicle, [weapon] with the name of the weapon, [trig1] and [trig2] with the names of the trigger volumes.

(script dormant weapon
(sleep_until (volume_test_objects [trig2] (players)) 15)
(object_create [weapon])
)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(wake weapon)
)


This'll create the vehicle, when you enter the trigger volume, and it'll wake the weapon script.

Edit: Thanks Me KS for catching that.
Edited by Gamma927 on Apr 17, 2009 at 05:47 PM


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Apr 17, 2009 05:06 PM    Msg. 5 of 33       
^ You need the "wake" command to wake up the dormant script.

Just add this line at the end of the "startup" script before its closing parentheses ")":

(wake weapon)


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 18, 2009 09:37 AM    Msg. 6 of 33       
Quote: --- Original message by: Gamma927

You want to have it so that when you enter a trigger volume, a vehicle appears, and then if you enter another trigger volume AFTER the vehicle is made, a weapon appears?

Replace [vehicle] with the name of the vehicle, [weapon] with the name of the weapon, [trig1] and [trig2] with the names of the trigger volumes.

(script dormant weapon
(sleep_until (volume_test_objects [trig2] (players)) 15)
(object_create [weapon])
)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(wake weapon)
)


This'll create the vehicle, when you enter the trigger volume, and it'll wake the weapon script.

Edit: Thanks Me KS for catching that.
Edited by Gamma927 on Apr 17, 2009 at 05:47 PM


Hmmmm.. And how is that if I want, if you go in the first trigger, then a vehicle appears, but if you use the car then, first then the second trigger should appear. Is that possible?

But thx for help


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Apr 18, 2009 10:22 AM    Msg. 7 of 33       
add a second condition to the weapon script about checking the seat of the car for a player. BTW, is this for a SP or MP map?


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 18, 2009 10:23 AM    Msg. 8 of 33       
It's for MP. So how should i write it?


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Apr 18, 2009 10:29 AM    Msg. 9 of 33       
im not sure about the syntax, but it might be like this:


(script dormant weapon
(sleep_until ((volume_test_objects [trig2] (players)) and
(vehicle_test_seat_list [vehicle] "driver" (players))) 15)
(object_create [weapon])
)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(wake weapon)
)


note the line break on the first sleep command would not exist
Edited by Headhunter09 on Apr 18, 2009 at 10:30 AM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 18, 2009 10:51 AM    Msg. 10 of 33       
You need an if statement, or a sleep until to use the vehicle test seat list, because it's a boolean. Something like this:


(script dormant weapon
(sleep_until (volume_test_objects [trig2] (players)) 15)
(sleep_until (volume_test_object_list [vehicle] "driver" (players)) 15)
(object_create [weapon])
)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(wake weapon)
)


Note: Since this is for MP, you have to replace all the 15s, with 0. Then copy the script, and paste it again, while changing the 0 to a 1. Keep doing that until you get to 15, because this needs to work for all players.


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Apr 18, 2009 10:54 AM    Msg. 11 of 33       
but that still doesn't accomplish the task. if they enter the place and then get in the vehicle, that's different than entering the volume with the hog. if anything, flip the sleep until statements.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 18, 2009 11:29 AM    Msg. 12 of 33       
Quote: --- Original message by: Headhunter09
but that still doesn't accomplish the task. if they enter the place and then get in the vehicle, that's different than entering the volume with the hog. if anything, flip the sleep until statements.


Oh, is that what he wanted? Then use this:

(global short x 0)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(set x 1)
)

(script continuous weapon_spawn
(if
(and
(= 1 x)
(volume_test_seat_list [vehicle] "driver" (players))
(volume_test_objects [trig2] (players)) 15)
)
(begin
(object_create [weapon])
(set x 2)
)
)
)


Edit: Found some redundancies.
Edited by Gamma927 on Apr 18, 2009 at 11:30 AM


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 08:46 AM    Msg. 13 of 33       
Quote: --- Original message by: Gamma927

Quote: --- Original message by: Headhunter09
but that still doesn't accomplish the task. if they enter the place and then get in the vehicle, that's different than entering the volume with the hog. if anything, flip the sleep until statements.


Oh, is that what he wanted? Then use this:

(global short x 0)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(set x 1)
)

(script continuous weapon_spawn
(if
(and
(= 1 x)
(volume_test_seat_list [vehicle] "driver" (players))
(volume_test_objects [trig2] (players)) 15)
)
(begin
(object_create [weapon])
(set x 2)
)
)
)


Edit: Found some redundancies.
Edited by Gamma927 on Apr 18, 2009 at 11:30 AM


Is this now what I want?
I repeat: You go in [trig1], then [vehicle] appears. Now you use this vehicle and first then you can use [trig2]. Then when you used [trig2], [weapon] appears.


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Apr 19, 2009 09:03 AM    Msg. 14 of 33       
wait, so you hop in the vehicle and then if you use it to get the trig2 then you get the weapon?


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 09:14 AM    Msg. 15 of 33       
I think so. You use the vehicle (hop up), then and first then you can use the [trig2].
Edited by wilsonwilson1 on Apr 19, 2009 at 09:15 AM


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Apr 19, 2009 09:45 AM    Msg. 16 of 33       
so you only have to have used the vehicle, not trigger trig2 while in the vehicle?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 19, 2009 09:55 AM    Msg. 17 of 33       
The script works for what you want. Here's your order of events

1) Enter trigger volume trig1
2) Vehicle appears
3) Enter vehicle to unlock trig2
4) Enter trig2 to make a weapon appear


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Apr 19, 2009 09:59 AM    Msg. 18 of 33       
if thats what you wanted, my bad. This is the right one:

Quote: --- Original message by: Gamma927
You need an if statement, or a sleep until to use the vehicle test seat list, because it's a boolean. Something like this:


(script dormant weapon
(sleep_until (volume_test_object_list [vehicle] "driver" (players)) 15)
(sleep_until (volume_test_objects [trig2] (players)) 15)
(object_create [weapon])
)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(wake weapon)
)


Note: Since this is for MP, you have to replace all the 15s, with 0. Then copy the script, and paste it again, while changing the 0 to a 1. Keep doing that until you get to 15, because this needs to work for all players.


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 10:51 AM    Msg. 19 of 33       
Headhunter09, it's ok ;)

Sorry for the following message but it doesn't still work. I tried to variate it but I get this exceptions:
[dormant_weapon line 1] this left paranthesis is unmatched.: (script dormant weapon
[startup_vehicle line 3] the value of this expression (on a slot) can never be used.: true)
recompiling scripts after scenarios were merged.
this left paranthesis is unmatched.: (script dormant weapon
[startup_vehicle line 1] this left paranthesis is unmatched.: (sciprt startup vehicle

I changed the first line with script contiuous dormant weapon but then i get same error.

Sorry for this again but I'm really new with scripting. I can some commands but I've never worked with such commands.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 19, 2009 10:58 AM    Msg. 20 of 33       
What was your error for the script before you changed it?


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 11:15 AM    Msg. 21 of 33       
[dormant_weapon line 2] this is not a valid function or script name.: volume_test_object_list pol
[startup_vehicle line 4] this is not a valid script name.: weapon)
recompiling scripts after scenarios were merged.
[dormant_weapon line 1] this left parenthesis is unmatched.: (script dormant weapon
[startup_vehicle line 1] this left parenthesis is unmatched.: (script startup vehicle

This was the error before i changed it.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 19, 2009 11:25 AM    Msg. 22 of 33       
Is the script (script dormant weapon ABOVE the script (script startup vehicle?


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 11:40 AM    Msg. 23 of 33       
I made 2 scripts because I thaught if I make it in one script it would be wrong.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 19, 2009 12:07 PM    Msg. 24 of 33       
From now on, put all your scripts into one .hsc file. When you compile scripts, there is a limit of four .hsc files, but you can put infinite scripts into one .hsc.


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 01:12 PM    Msg. 25 of 33       
Ok I'll do it :D

So but now again to my problem. How to fix these problems?


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 19, 2009 02:04 PM    Msg. 26 of 33       
That WAS your problem apparently. One of them, at least. Do what I said, and give me your new problems.


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 02:46 PM    Msg. 27 of 33       
Ok I've done what you said and now this appears:
[startup vehicle line 4] this is not a valid script name.: weapon)
recompiling scripts after scenarios were merged.
[startup vehicle line 1] this left parenthesis is unmatched.: (script startup vehicle

I made first script startup vehicle and then script dormant weapon.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 19, 2009 02:54 PM    Msg. 28 of 33       
Dormant weapon goes on top. The compiler reads it from top to bottom, and if you don't define weapon before the wake command, it won't recognize it, so it won't compile. Put dormant weapon above vehicle. And this won't work for MP if you just put this. You have to do the same thing for all players, so replace all the 15's with 0s. Then, copy and paste the script, and make all the 0s in the copy to 1. You also have to rename the script names as well. Repeat the process until you've replaced all the 14s with 15s. Then compile the scripts.


wilsonwilson1
Joined: Apr 10, 2009


Posted: Apr 19, 2009 03:09 PM    Msg. 29 of 33       
[script line 1] script type must be "startup", "dormant", "continuous", or "static".: dormant_weapon
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (script dormant_weapon

Now this appears. Maybe I'm doing something wrong but I'm sure I did all what you've said.


RougeSpartan414
Joined: Sep 24, 2007

Angatar, the Iron-Father.


Posted: Apr 19, 2009 03:10 PM    Msg. 30 of 33       
Wrong thread.
Edited by RougeSpartan414 on Apr 19, 2009 at 03:11 PM


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Apr 19, 2009 03:16 PM    Msg. 31 of 33       
you put an under thing "_" between startup and vehicle

E: rather, dormant and weapon
Edited by Headhunter09 on Apr 19, 2009 at 03:16 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Apr 19, 2009 04:59 PM    Msg. 32 of 33       
Quote: --- Original message by: wilsonwilson1
[script line 1] script type must be "startup", "dormant", "continuous", or "static".: dormant_weapon
recompiling scripts after scenarios were merged.
this left parenthesis is unmatched.: (script dormant_weapon

Now this appears. Maybe I'm doing something wrong but I'm sure I did all what you've said.


If you did what I said, then it should work :P

Try this: Copy and paste the exact lines of code written above, and put them into one .hsc file. Then fill in the blanks.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Apr 19, 2009 08:49 PM    Msg. 33 of 33       
Quote: --- Original message by: Headhunter09

(script dormant weapon
(sleep_until (volume_test_object_list [vehicle] "driver" (players)) 15)
(sleep_until (volume_test_objects [trig2] (players)) 15)
(object_create [weapon])
)

(script startup vehicle
(sleep_until (volume_test_objects [trig1] (players)) 15)
(object_create [vehicle])
(wake weapon)
)



Heh. The whole time it was just this, and nobody noticed it:

Quote: --- Original message by: wilsonwilson1
[dormant_weapon line 2] this is not a valid function or script name.: volume_test_object_list pol


It means what it says. "volume_test_object_list" is a typo and isn't a command. He meant to put "vehicle_test_seat_list". That typo probably caused all of the other errors as well.

Other than that, the script is fine.

Quote: --- Original message by: Gamma927
Dormant weapon goes on top. The compiler reads it from top to bottom, and if you don't define weapon before the wake command, it won't recognize it, so it won't compile. Put dormant weapon above vehicle. And this won't work for MP if you just put this. You have to do the same thing for all players, so replace all the 15's with 0s. Then, copy and paste the script, and make all the 0s in the copy to 1. You also have to rename the script names as well. Repeat the process until you've replaced all the 14s with 15s. Then compile the scripts.


"sleep_until" has two arguments, and none of them involves the player number. The "15" is just the interval measured in ticks between when the script checks the "expression" that "sleep_until" is testing for to see if it's true and then continue with the other commands. So, the "15" being changed in copies of the scripts doesn't help with making this work in multiplayer.

You'd have to change the "volume_test_objects" to "volume_test_object" and then use "(list_get (players) #)" for its "object" argument in each script, and also change "vehicle_test_seat_list" to "vehicle_test_seat" and use "(list_get (players) #)" in its "object" argument. Then you could copy the scripts and change those numbers from 0 - 15, like you said. Though, I wouldn't do it that way. Way too clumsy having 16 startup and 16 dormant scripts. But it would work.

As the script is set up now though, it waits until any player enters the first trigger volume, and if so, spawns the vehicle. Then, it waits until any player enters the driver's seat of that vehicle, and then waits until any player goes into the second trigger volume, and then spawns the weapon. So it actually will work for multiplayer, but probably not the way wilsonwilson1 wants it to work.

Since any player can activate any parts of the script, that means some guy could be sitting in the hog 5000 miles away and some other guy could be standing in the second trigger volume and that would be enough to spawn the weapon. And the guy sitting in the hog didn't have to be the same guy who stepped in the first trigger volume to spawn it.

 

 
Previous Older Thread    Next newer Thread







Time: Thu January 19, 2023 10:00 AM 125 ms.
A Halo Maps Website