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 »help with my script

Author Topic: help with my script (15 messages, Page 1 of 1)
Moderators: Dennis

shadowslayer123
Joined: Feb 22, 2009

Not the american average


Posted: Jul 28, 2009 02:03 PM    Msg. 1 of 15       
for my map i made a script that is supposed to destroy a vehicle after the player kills a ai encounter with it, here is my script so far:

(script continuous waypointmaker
(if (vehicle_test_seat_list drive_mei "B-driver"
(players)) (deactivate_team_nav_point_object "player" drive_mei)
(activate_team_nav_point_object "default" "player" drive_mei 1))
)

(script startup destroyer
(sleep_until ( = (ai_living_count "test") 0 ) )
(object_destroy drive_mei)
)


the top line makes it so a waypoint appears over it, the bottom one makes it so it is destroyed when you kill an encounter. now the point of this topic is that i want to make it so that the vehicle appears, makes the player get into it and player has to kill the ai, once the player lands with the aircraft i am using, it gets destroyed but only after the ai are dead so that way if the player lands when ai are still alive, the vehicle wont be destroyed. the current script up there only destroyes the vehicle if the player is not in it and the encounter is dead. after you kill the encounter if you are still in the vehicle, it will never get destroyed. any help would be appreciated and by land i mean the player gets out of the vehicle.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jul 28, 2009 04:21 PM    Msg. 2 of 15       
I hate your formatting.

Fix'd (I hope)

(global boolean bansheeExists true)

(script continuous waypointmaker
(if
(and
(vehicle_test_seat_list drive_mei "B-driver" (players))
(= bansheeExists true)
)
(begin
(deactivate_team_nav_point_object "player" drive_mei)
)
(begin
(activate_team_nav_point_object "default" "player" drive_mei 1))
)
)
)

(script startup destroyer
(sleep_until (= (ai_living_count "test") 0) 15)
(object_destroy drive_mei)
(set bansheeExists false)
)


shadowslayer123
Joined: Feb 22, 2009

Not the american average


Posted: Jul 28, 2009 05:24 PM    Msg. 3 of 15       
it says in script line 16 it expects a script variable or definition
Edited by shadowslayer123 on Jul 28, 2009 at 05:25 PM


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jul 28, 2009 06:24 PM    Msg. 4 of 15       
Show us your entire script, so I know what line 16 is.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Jul 29, 2009 02:20 AM    Msg. 5 of 15       
Quote: --- Original message by: shadowslayer123
after you kill the encounter if you are still in the vehicle, it will never get destroyed.


That's the one and only problem with your script. Everything else is good.

And it's not an error on your part. It's supposed to be that way. You, the player, are still in the vehicle when "object_destroy" tries to run. If it destroys the vehicle, then it has to destroy you too, which can't happen because you're a player. So, the end result is that it doesn't destroy the vehicle.

But, there are two easy solutions: either wait for the player to get out of the vehicle to destroy it, or force him out and then destroy it.

To wait for the player to get out, use this:

(script startup destroyer 
(sleep_until (and
(= (vehicle_test_seat_list drive_mei "B-driver" (players)) 0)
(= (ai_living_count "test") 0)
) 1)
(object_destroy drive_mei)
)


To force him out, use this:

(script startup destroyer 
(sleep_until (= (ai_living_count "test") 0))
(vehicle_unload drive_mei "")
(unit_set_enterable_by_player drive_mei 0)
(sleep_until (= (vehicle_test_seat_list drive_mei "B-driver" (players)) 0) 1)
(object_destroy drive_mei)
)


shadowslayer123
Joined: Feb 22, 2009

Not the american average


Posted: Jul 29, 2009 09:46 AM    Msg. 6 of 15       
sadly, meks's script doesnt work if you kill the encounter while you are inside the vehicle, and i am afraid the bottom one might cause problems when the player is ejected


Headhunter09
Joined: May 6, 2008

This is the truth.


Posted: Jul 29, 2009 10:50 AM    Msg. 7 of 15       
or you could design the level so the player has to get out of the vehicle, and can't proceed. That way you don't even have to destroy the vehicle.


shadowslayer123
Joined: Feb 22, 2009

Not the american average


Posted: Jul 29, 2009 10:54 AM    Msg. 8 of 15       
good idea, how would a script that stops the level from continuing unless the player gets out in a trigger volume or something, and are trigger volumes destroyable


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jul 29, 2009 11:20 AM    Msg. 9 of 15       
You can't destroy trigger volumes, but you can use variables to prevent trigger volumes from activating.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: Jul 29, 2009 12:51 PM    Msg. 10 of 15       
Quote: --- Original message by: shadowslayer123
sadly, meks's script doesnt work if you kill the encounter while you are inside the vehicle, and i am afraid the bottom one might cause problems when the player is ejected


The first script waits until the player gets out on his own free will, so of course it won't work when the encounter is killed while you're still inside. And there's nothing wrong with the second one. The player gets ejected and the banshee is made not enterable so he has no chance of getting back in. Then, it waits until the player is out of the vehicle so the banshee is guaranteed to be destroyed.

But regardless, HeadHunter's idea is best. Most players won't understand why they mysteriously were forced out of the shee and why it disappeared just after that. So it's best not to destroy the shee or force the player out.


shadowslayer123
Joined: Feb 22, 2009

Not the american average


Posted: Jul 29, 2009 01:34 PM    Msg. 11 of 15       
yeah, headhunters is a good one, so how would i make it so the player goes and fights a encounter and then has to land in a certain spot which will be a trigger volume marked by a waypoint and after he walks out of the trigger volume the vehicle is destroyed


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jul 29, 2009 02:06 PM    Msg. 12 of 15       
Why destroy it? If you don't want the player to re-enter it, there's a scripting command that prevents the player from using a certain vehicle.


shadowslayer123
Joined: Feb 22, 2009

Not the american average


Posted: Jul 29, 2009 02:37 PM    Msg. 13 of 15       
sounds good, so my plan is to make a banshee appear with a waypoint over it, when the player gets in the waypoint goes away and bots appear, the player has to kill bots, once the bots are dead the player lands and the banshee locks up, is this possible


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: Jul 29, 2009 03:06 PM    Msg. 14 of 15       
Yes.


shadowslayer123
Joined: Feb 22, 2009

Not the american average


Posted: Jul 29, 2009 04:44 PM    Msg. 15 of 15       
good, can you help me make it like that?

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 12:48 PM 141 ms.
A Halo Maps Website