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 »custom vehicle spawn points screwed up....

Author Topic: custom vehicle spawn points screwed up.... (16 messages, Page 1 of 1)
Moderators: Dennis

sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: May 13, 2009 10:12 AM    Msg. 1 of 16       
hi again.

when spawning custom vehicles in bloodgulch, i used this script:

(script startup vehiclespawn
(object_create_anew hog1)
(object_create_anew hog2)
(object_create_anew hog3)
(object_create_anew hog4)
(object_create_anew hog5)
(object_create_anew hog6)
(object_create_anew hog7)
(object_create_anew hog8)
(object_create_anew hog9)
(object_create_anew hog10)
(object_create_anew hog11)
(object_create_anew hog12)
(object_create_anew hog13)
(object_create_anew hog14)
(object_create_anew hog15)
(object_create_anew hog16)
(object_create_anew hog17)
(object_create_anew hog18)
(object_create_anew scorp1)
(object_create_anew scorp2)
(object_create_anew ghost1)
(object_create_anew ghost2)
(object_create_anew ghost3)
(object_create_anew ghost4)
(object_create_anew shee1)
(object_create_anew shee2)
(object_create_anew laagturret1)
(object_create_anew laagturret2)
(object_create_anew spectre1)
(object_create_anew spectre2)
(object_create_anew jeep1)
)

with the custom vehicles being the jeep, spectre and laagturret. However, after compiling the .map file and playing it, i found that my vehicles were being spawned in the wrong place after i drove them off and left them somewhere else (eg. the blue team's jeep appearing at blue team's banshee spawn even though i didn't tell it to and i had drove the jeep off earlier).

what is wrong, and how can i fix it?


Polamee
Joined: Feb 25, 2008

MP2SPMT's founder


Posted: May 13, 2009 10:19 AM    Msg. 2 of 16       
Is this SP or MP?


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: May 13, 2009 10:21 AM    Msg. 3 of 16       
Quote: --- Original message by: Polamee
Is this SP or MP?


This map's an MP map.


Sabre
Joined: Dec 10, 2008

I joined RB in protecting Donut's avatar.


Posted: May 13, 2009 10:31 AM    Msg. 4 of 16       
Did you make sure that the first vehicle spawn point is left blank? I remember being told this makes all scripted vehicles spawn at the right spot instead of at the first vehicle's spawn.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: May 13, 2009 02:15 PM    Msg. 5 of 16       
The game considers certain vehicles as extras. This includes vehicles that aren't in the globals, and vehicles that go past the 8 vehicle per type limit. By default, these vehicles wouldn't spawn at all. But, if they're forced to spawn through scripts, then these vehicles never respawn back to their proper spawn points, but instead always respawn at the first vehicle spawn point in the list of vehicles in Sapien.

This can be fixed with scripts, though, and I wrote up a short tutorial a while ago:

Quote: --- Original message by: Me KS
1. In your "Vehicles" list in Sapien, place a vehicle spawn point in a location where no player can go. Set the spawn point's vehicle type to "NONE" so no vehicle actually spawns there. This spawn point has to be the very first in the list of vehicles in Sapien.

The reason for this is all vehicles that the game considers "extra" are respawned to the first vehicle spawn point, no matter where their actual spawn points are. So we take advantage of that here.

2. Place a trigger volume (Game Data > Trigger Volumes) over this spawn point. Make sure the trigger volume is larger than the largest vehicle that you need a script to respawn. For example, if you have two scorpions, a hog, and a ghost, make the trigger volume at least as large as the scorpion. Name this trigger volume whatever you want.

This will be used to check to see when the vehicle has respawned to the first spawn point, then re-create it that very same moment to bring it back to its true spawn point.

3. Also, place a new vehicle of any type (hog, ghost, anything. Preferably something small) in either the same area (away from the trigger volume) or in a different location that the player can't go to. Name this vehicle "host_check", and set it to spawn BY DEFAULT in all game types. Make sure it's a vehicle that is in the globals so it'll spawn by itself, otherwise this won't work.

This is to check in the scripts to make sure the game doing all of this is the server. It works because the vehicles are server-side only, and so if you try to check for a vehicle's existence and you're not the server, it will say the vehicle doesn't exist, which lets us check and see who's the server. If we allowed the script to run without making sure only the server is making the changes, then there would be two vehicles spawned for each spawn point: one is the real server-side one, and the other is a client-side copy that doesn't exist on the server and so is just useless and annoying to players.

4. With all of the vehicles that you need scripted in, place them where you need them and set their properties as usual. Just remember to give each one a unique name for the scripts.

5. Then, you're ready to actually do the script:


(global boolean server 0)

(script startup vehicles
(if
(>= (unit_get_health host_check) 0)
(set server 1)
)
(if
(= server 1)
(begin
(object_create "first vehicle")
(object_create "second vehicle")
;; etc, repeat for each one
)
)
)

(script continuous respawn_stuff
(if
(= server 1)
(begin
(if
(volume_test_object "trigger volume name" "first vehicle")
(object_create_anew "first vehicle")
)
(if
(volume_test_object "trigger volume name" "second vehicle")
(object_create_anew "second vehicle")
)
;; repeat each of these (if)'s for each vehicle. Use copy-pasting to do it faster.
)
(sleep_until (= 0 1))
)
)


Just replace the things in "quotes" and compile, and then test.

Edited by Me KS on May 13, 2009 at 02:16 PM


Sabre
Joined: Dec 10, 2008

I joined RB in protecting Donut's avatar.


Posted: May 13, 2009 02:20 PM    Msg. 6 of 16       
Quote: --- Original message by: Me KS

The game considers certain vehicles as extras. This includes vehicles that aren't in the globals, and vehicles that go past the 6 vehicle per type limit. By default, these vehicles wouldn't spawn at all. But, if they're forced to spawn through scripts, then these vehicles never respawn back to their proper spawn points, but instead always respawn at the first vehicle spawn point in the list of vehicles in Sapien.
Edited by Me KS on May 13, 2009 at 02:16 PM


ftfy.

Also, I've tested it and scripted vehicles will respawn at their intended places if the first spawn point is left as NONE type.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: May 13, 2009 02:39 PM    Msg. 7 of 16       
I wasn't talking about the limit on the types of vehicles in the globals. I already mentioned that. I know it's 6. I meant how many vehicles per type. More specifically, it's how many vehicles per type allowed per game type. That is 8.

As in, the limit for how many warthogs on the map for each game type is 8. The limit for how many ghosts for each game type is 8. Etc. That limit.

Also, you sure about that? If your scripted vehicle was in the globals and there weren't more than 8 vehicles of that type after you spawned it, then it should still respawn normally even if you created it through a script, which is what you said happened.

The only reason someone should script vehicles in is because either:

A: They need more than 6 types of vehicles
B: They need more than 8 vehicles of one type for one or more types of vehicles
C: All of the above

Otherwise, the game can handle it for itself.


Sabre
Joined: Dec 10, 2008

I joined RB in protecting Donut's avatar.


Posted: May 13, 2009 03:48 PM    Msg. 8 of 16       
Quote: --- Original message by: Me KS
I wasn't talking about the limit on the types of vehicles in the globals. I already mentioned that. I know it's 6. I meant how many vehicles per type. More specifically, it's how many vehicles per type allowed per game type. That is 8.

As in, the limit for how many warthogs on the map for each game type is 8. The limit for how many ghosts for each game type is 8. Etc. That limit.

Also, you sure about that? If your scripted vehicle was in the globals and there weren't more than 8 vehicles of that type after you spawned it, then it should still respawn normally even if you created it through a script, which is what you said happened.

The only reason someone should script vehicles in is because either:

A: They need more than 6 types of vehicles
B: They need more than 8 vehicles of one type for one or more types of vehicles
C: All of the above

Otherwise, the game can handle it for itself.


I've used vehicles outside of my globals, my only reason for scripting them in.
So, I gave them all names that had the letter "O" in them, I used object_create_anew_containing o and they all spawned, then later I used "game reset" and they respawned where they were supposed to because I had the first vehicle spawn point noted as NONE type.

Make sense now?


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: May 13, 2009 07:53 PM    Msg. 9 of 16       
Quote: --- Original message by: Sabre
I've used vehicles outside of my globals, my only reason for scripting them in.
So, I gave them all names that had the letter "O" in them, I used object_create_anew_containing o and they all spawned, then later I used "game reset" and they respawned where they were supposed to because I had the first vehicle spawn point noted as NONE type.

Make sense now?


Actually that confuses me more. There is no "game_reset", so I'm assuming you mean "game_revert," right? Well, that command completely restarts the map, since it's meant to bring you back to your last checkpoint but it's a multiplayer map. It's the same as doing "New Game" from the menu but without waiting and with minor glitches, like having an empty name when the map starts.

I tried it after spawning a vehicle not in the globals, and it wasn't spawned after I did "game_revert". So I have no idea how you managed to respawn the vehicle doing that command. Unless you mean "sv_map_reset" which is the same as the "Restart Game" button on the UI.

But that's not the point.

If you do "sv_map_reset" or "Restart Game" on the menu, then the vehicle will reset to the first spawn point and won't respawn correctly.

Either do that, or just set the respawn time to 30 seconds and do it the most reliable way and wait for it to respawn normally and see where it respawns. It won't respawn correctly. It will respawn to that first blank spawn point. And that's what matters in-game.


Sabre
Joined: Dec 10, 2008

I joined RB in protecting Donut's avatar.


Posted: May 13, 2009 09:18 PM    Msg. 10 of 16       
Quote: --- Original message by: Me KS
Quote: --- Original message by: Sabre
I've used vehicles outside of my globals, my only reason for scripting them in.
So, I gave them all names that had the letter "O" in them, I used object_create_anew_containing o and they all spawned, then later I used "game reset" and they respawned where they were supposed to because I had the first vehicle spawn point noted as NONE type.

Make sense now?


Actually that confuses me more. There is no "game_reset", so I'm assuming you mean "game_revert," right? Well, that command completely restarts the map, since it's meant to bring you back to your last checkpoint but it's a multiplayer map. It's the same as doing "New Game" from the menu but without waiting and with minor glitches, like having an empty name when the map starts.

I tried it after spawning a vehicle not in the globals, and it wasn't spawned after I did "game_revert". So I have no idea how you managed to respawn the vehicle doing that command. Unless you mean "sv_map_reset" which is the same as the "Restart Game" button on the UI.

But that's not the point.

If you do "sv_map_reset" or "Restart Game" on the menu, then the vehicle will reset to the first spawn point and won't respawn correctly.

Either do that, or just set the respawn time to 30 seconds and do it the most reliable way and wait for it to respawn normally and see where it respawns. It won't respawn correctly. It will respawn to that first blank spawn point. And that's what matters in-game.


That's what I meant.

For some reason we've seen different results, yet do the same thing... odd.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: May 13, 2009 10:31 PM    Msg. 11 of 16       
Quote: --- Original message by: Sabre
That's what I meant.

For some reason we've seen different results, yet do the same thing... odd.


Oh ok. Yeah I'm not sure either. All I know is the scripting is needed, because maps that exceed the vehicle limits like Coldsnap use a script like that.


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: May 14, 2009 08:32 AM    Msg. 12 of 16       
ok i went to try out a solution.....

i extracted gephyrophobia, then renamed the .scenario file gephyrophobia_v2.
then, i created a vehicle spawn point (which has vehicle to spawn set to none)
after that, i created imported 2 vehicles and placed them in sapien (1 wasp and 1 banshee)
saved the .scenario file, then compiled it.
worked fine up to here.

however, i got in game, and PURPOSELY made the vehicles fall down the "bottomless pit" (although it isn't exactly bottomless)
i waited for 5 min and the vehicles didn't spawn back to their original positions
(they disappeared...)
even though they were set to respawn in 2 min

what's going on?


Sabre
Joined: Dec 10, 2008

I joined RB in protecting Donut's avatar.


Posted: May 14, 2009 10:46 AM    Msg. 13 of 16       
Quote: --- Original message by: sargejohnson
ok i went to try out a solution.....

i extracted gephyrophobia, then renamed the .scenario file gephyrophobia_v2.
then, i created a vehicle spawn point (which has vehicle to spawn set to none)
after that, i created imported 2 vehicles and placed them in sapien (1 wasp and 1 banshee)
saved the .scenario file, then compiled it.
worked fine up to here.

however, i got in game, and PURPOSELY made the vehicles fall down the "bottomless pit" (although it isn't exactly bottomless)
i waited for 5 min and the vehicles didn't spawn back to their original positions
(they disappeared...)
even though they were set to respawn in 2 min

what's going on?


Scripted vehicles don't respawn on their own, they need to have a scripted respawn.


Gamma927
Joined: Jun 12, 2008

Steam: gamma927


Posted: May 14, 2009 06:13 PM    Msg. 14 of 16       
Do a sleep command, and then do another object_create_anew. I think Me KS has a sync command for them.


Me KS
Joined: Feb 2, 2008

Desire is Reality. Xfire: jetmaster23


Posted: May 14, 2009 09:04 PM    Msg. 15 of 16       
Quote: --- Original message by: sargejohnson
ok i went to try out a solution.....

i extracted gephyrophobia, then renamed the .scenario file gephyrophobia_v2.
then, i created a vehicle spawn point (which has vehicle to spawn set to none)
after that, i created imported 2 vehicles and placed them in sapien (1 wasp and 1 banshee)
saved the .scenario file, then compiled it.
worked fine up to here.

however, i got in game, and PURPOSELY made the vehicles fall down the "bottomless pit" (although it isn't exactly bottomless)
i waited for 5 min and the vehicles didn't spawn back to their original positions
(they disappeared...)
even though they were set to respawn in 2 min

what's going on?


Unless you already tried it and you're saying something went wrong, read the tutorial I posted above in my first post in this topic. It tells you how to set up for the script, and also tells you what to do with the vehicles, and gives you a script template that covers all the spawning and respawning. You just have to add the names of certain things into the script that you already placed in the steps before.


sargejohnson
Joined: Apr 20, 2009

Shall we play a game?


Posted: May 15, 2009 08:33 AM    Msg. 16 of 16       
thanks for the script template. However, i got into this problem after trying Me KS's method....
here's the last paragraph of my debug_txt...

05.15.09 20:26:41 a hobo pc 01.01.00.0609 ----------------------------------------------
05.15.09 20:26:41 reference function: _write_to_error_file
05.15.09 20:26:41 reference address: 401b13
05.15.09 20:26:41 Couldn't read map file './a_hobobeta.map'
05.15.09 20:26:41 CreateDevice succeeded with refresh rate = 0
05.15.09 20:26:42 Increasing sound decompression buffer size to 1048576 bytes
05.15.09 20:26:44 WARNING: 22 clusters in structure_bsp levels\test\gephyrophobia\gephyrophobia have no background sound or sound environment.
05.15.09 20:26:45 local player 0, weapon (0x0), deleted unexpectedly
05.15.09 20:26:51 [script_vehicle_spawn line 17] this left parenthesis is unmatched.: (script continuous respawn_stuff

05.15.09 20:26:51 recompiling scripts after scenarios were merged.
05.15.09 20:26:51 this left parenthesis is unmatched.: (script continuous respawn_stuff

05.15.09 20:27:01 [script_vehicle_spawn line 17] this left parenthesis is unmatched.: (script continuous respawn_stuff

05.15.09 20:27:01 recompiling scripts after scenarios were merged.
05.15.09 20:27:01 this left parenthesis is unmatched.: (script continuous respawn_stuff


and here is the script i modified using Me KS's script template:

(global boolean server 0)
(script startup vehicles
(if
(>= (unit_get_health host_check) 0)
(set server 1) )
(if
(= server 1)
(begin

(object_create "wasp_1")
(object_create "banshee_1")
;; etc, repeat for each one

)
)
)
(script continuous respawn_stuff
(if
(= server 1)
(begin
(if (volume_test_object "vehicle_spawn" "wasp_1") (object_create_anew "wasp_1") ) (if (volume_test_object "banshee_1" "banshee_1")
(object_create_anew "banshee_1") )
;; repeat each of these (if)'s for each vehicle. Use copy-pasting to do it faster. )
(sleep_until (= 0 1))))

apparently sapien says that something is wrong with line 17 of my script, but i can't figure it out.
what is wrong?
Edited by sargejohnson on Jun 3, 2009 at 02:12 AM

 

 
Previous Older Thread    Next newer Thread







Time: Fri January 20, 2023 6:11 AM 141 ms.
A Halo Maps Website