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 »Help with scripting vehicles!!

Author Topic: Help with scripting vehicles!! (5 messages, Page 1 of 1)
Moderators: Dennis

helldeath360
Joined: May 23, 2015


Posted: Jan 13, 2018 06:49 PM    Msg. 1 of 5       
Hello, I scripted more than 6 vehicles... everything went ok. but during the game, I realized that when the time passes, and the vehicles don't respawn where I placed it doesn't appear there, I mean, all the scripted vehicles appear where I put the first vehicle, they don't respawn where I placed them (I hope you understood). Please, help me wit this.
Edited by helldeath360 on Jan 13, 2018 at 06:49 PM
Edited by helldeath360 on Jan 13, 2018 at 06:50 PM


DeadHamster
Joined: Jun 8, 2014


Posted: Jan 13, 2018 06:53 PM    Msg. 2 of 5       
Yes, they will go to the first location. There's a way to fix this using scripts, I believe I have a copy of a friend's scripts that I can get in touch with. He did this in a map called Carthage, let me see if he still has the scripts kicking around and we'll get back to you.


Inigo_Montoya
Joined: Jan 13, 2018


Posted: Jan 13, 2018 07:53 PM    Msg. 3 of 5       

(global short prog1 1)
(global short prog2 1)
(global short prog3 1)
(global short prog4 1)

(script continuous spawnshee1

(sleep_until (= prog1 0) 5)

(object_create_anew dead1)

(objects_attach live1 "driver" dead1 "driver")

(objects_detach live1 dead1)

(object_destroy live1)

(sleep_until (volume_test_object v_respawn dead1) 5)

(object_destroy dead1)

(object_create_anew live1)

(set prog1 1)

)

(script continuous spawnshee2

(sleep_until (= prog2 0) 5)

(object_create_anew dead2)

(objects_attach live2 "driver" dead2 "driver")

(objects_detach live2 dead2)

(object_destroy live2)

(sleep_until (volume_test_object v_respawn dead2) 5)

(object_destroy dead2)

(object_create_anew live2)

(set prog2 1)

)


(script continuous spawnshee3

(sleep_until (= prog3 0) 5)

(object_create_anew dead3)

(objects_attach live3 "driver" dead3 "driver")

(objects_detach live3 dead3)

(object_destroy live3)

(sleep_until (volume_test_object v_respawn dead3) 5)

(object_destroy dead3)

(object_create_anew live3)

(set prog3 1)

)


(script continuous spawnshee4


(sleep_until (= prog4 0) 5)

(object_create_anew dead4)

(objects_attach live4 "driver" dead4 "driver")

(objects_detach live4 dead4)

(object_destroy live4)

(sleep_until (volume_test_object v_respawn dead4) 5)

(object_destroy dead4)

(object_create_anew live4)

(set prog4 1)

)




(script continuous sleepforbanshee1

(sleep_until (= (unit_get_health live1) 0) 5)

(set prog1 0)

(sleep_until (= prog1 1))




)



(script continuous sleepforbanshee2

(sleep_until (= (unit_get_health live2) 0) 5)

(set prog2 0)

(sleep_until (= prog2 1))



)



(script continuous sleepforbanshee3

(sleep_until (= (unit_get_health live3) 0) 5)

(set prog3 0)

(sleep_until (= prog3 1))



)



(script continuous sleepforbanshee4

(sleep_until (= (unit_get_health live4) 0) 5)

(set prog4 0)

(sleep_until (= prog4 1))




)









So the way this works is first you take a dummy vehicle that has no purpose and place it outside the map. You put a trigger volume around this initial vehicle spawn and then you place your real vehicles and name them live1, live2, etc and then you place destroyed versions of those and name them dead1, dead2, etc.


The script tracks the health so when live1 has no health it destroys live1 and replaces it with dead1 which then crashes to the ground.


When live1 respawns it will respawn at the dummy vehicle spawn point. This is outside the map but in a trigger volume. As soon as it respawns your script destroys it and recreates it which places it at the objects actual spawn point that you placed in sapien.


So if the object blows up, eventually it respawns and when it does, the script moves it from spawn point of vehicle 1 dummy (the glitch you have), to the actual spawn point you placed in sapien.

If a vehicle just respawns because the timer ran out it's moved to the spawn point of the dummy vehicle, and the script then pushes it back. This is only 5-10 ticks under worst scenarios, so shouldn't affect gameplay over a server.






All combined, this syncs destructible vehicles over a server in custom edition and makes them respawn properly, also synced.


helldeath360
Joined: May 23, 2015


Posted: Jan 25, 2018 04:38 PM    Msg. 4 of 5       
Quote: --- Original message by: Inigo_Montoya

(global short prog1 1)
(global short prog2 1)
(global short prog3 1)
(global short prog4 1)

(script continuous spawnshee1

(sleep_until (= prog1 0) 5)

(object_create_anew dead1)

(objects_attach live1 "driver" dead1 "driver")

(objects_detach live1 dead1)

(object_destroy live1)

(sleep_until (volume_test_object v_respawn dead1) 5)

(object_destroy dead1)

(object_create_anew live1)

(set prog1 1)

)

(script continuous spawnshee2

(sleep_until (= prog2 0) 5)

(object_create_anew dead2)

(objects_attach live2 "driver" dead2 "driver")

(objects_detach live2 dead2)

(object_destroy live2)

(sleep_until (volume_test_object v_respawn dead2) 5)

(object_destroy dead2)

(object_create_anew live2)

(set prog2 1)

)


(script continuous spawnshee3

(sleep_until (= prog3 0) 5)

(object_create_anew dead3)

(objects_attach live3 "driver" dead3 "driver")

(objects_detach live3 dead3)

(object_destroy live3)

(sleep_until (volume_test_object v_respawn dead3) 5)

(object_destroy dead3)

(object_create_anew live3)

(set prog3 1)

)


(script continuous spawnshee4


(sleep_until (= prog4 0) 5)

(object_create_anew dead4)

(objects_attach live4 "driver" dead4 "driver")

(objects_detach live4 dead4)

(object_destroy live4)

(sleep_until (volume_test_object v_respawn dead4) 5)

(object_destroy dead4)

(object_create_anew live4)

(set prog4 1)

)




(script continuous sleepforbanshee1

(sleep_until (= (unit_get_health live1) 0) 5)

(set prog1 0)

(sleep_until (= prog1 1))




)



(script continuous sleepforbanshee2

(sleep_until (= (unit_get_health live2) 0) 5)

(set prog2 0)

(sleep_until (= prog2 1))



)



(script continuous sleepforbanshee3

(sleep_until (= (unit_get_health live3) 0) 5)

(set prog3 0)

(sleep_until (= prog3 1))



)



(script continuous sleepforbanshee4

(sleep_until (= (unit_get_health live4) 0) 5)

(set prog4 0)

(sleep_until (= prog4 1))




)









So the way this works is first you take a dummy vehicle that has no purpose and place it outside the map. You put a trigger volume around this initial vehicle spawn and then you place your real vehicles and name them live1, live2, etc and then you place destroyed versions of those and name them dead1, dead2, etc.


The script tracks the health so when live1 has no health it destroys live1 and replaces it with dead1 which then crashes to the ground.


When live1 respawns it will respawn at the dummy vehicle spawn point. This is outside the map but in a trigger volume. As soon as it respawns your script destroys it and recreates it which places it at the objects actual spawn point that you placed in sapien.


So if the object blows up, eventually it respawns and when it does, the script moves it from spawn point of vehicle 1 dummy (the glitch you have), to the actual spawn point you placed in sapien.

If a vehicle just respawns because the timer ran out it's moved to the spawn point of the dummy vehicle, and the script then pushes it back. This is only 5-10 ticks under worst scenarios, so shouldn't affect gameplay over a server.






All combined, this syncs destructible vehicles over a server in custom edition and makes them respawn properly, also synced.


I am very thanked for your answering, but I didn't work :(. would you please, make a short video with an example please. I would appreciate it TOO MUCH


Spartan314
Joined: Aug 21, 2010

Former biped rigger & FP animator


Posted: Jan 27, 2018 11:37 PM    Msg. 5 of 5       
Could you like
not quote the entire post

 

 
Previous Older Thread    Next newer Thread







Time: Mon June 18, 2018 1:36 PM 203 ms.
A Halo Maps Website