
Bungie LLC
Joined: Dec 29, 2013
friendly neighborhood contrarian funposter
|
Posted: Nov 22, 2014 11:19 AM
Msg. 1 of 11
I know it has been around, and has been talked about many different times for a long while, on both Modacity and this site. CMT's old multiplayer maps had it implemented, supposedly without the use of scripts, and now so does Altis's bigass project. What I'm asking for is an easy, definitive explanation here, for both myself and for others who would also desire to know (since it is still not yet public knowledge, as with a lot of other neat "black art" shortcuts and implementations that have happened across the years), for a method that works. I have a very good knowledge of model_collision_geometry tags and the like, though I am not the most adept scripter. The simplest (and still effective) way, without the use of scripts, would be preferable. Thank you.
|
|
|

altis94
Joined: Oct 5, 2012
Join my Discord https://discord.gg/GDVEaRD
|
Posted: Nov 22, 2014 11:23 AM
Msg. 2 of 11
There is no way to do that without scripts.
|
|
|

Bungie LLC
Joined: Dec 29, 2013
friendly neighborhood contrarian funposter
|
Posted: Nov 22, 2014 11:24 AM
Msg. 3 of 11
Explain, then, if you please. I would, as well as others, I'm sure, would appreciate it.
|
|
|

altis94
Joined: Oct 5, 2012
Join my Discord https://discord.gg/GDVEaRD
|
Posted: Nov 22, 2014 11:50 AM
Msg. 4 of 11
Give vehicle shield http://puu.sh/d137C/d2f9fb0df8.png Script example: (script continuous scorpion_destruction (if (= is_host false) (sleep -1)) (sleep_until (or (= (unit_get_shield scorpion) 0) (volume_test_object trigvol scorpion))) (if (= (unit_get_shield scorpion) 0) (begin (sleep_until (begin (if (!= (list_count (vehicle_riders scorpion)) 0) (unit_kill (unit (list_get (vehicle_riders scorpion) 0)))) (= (list_count (vehicle_riders scorpion)) 0) ) 0 ) (object_create scorpion_destroyed) (objects_attach scorpion "" scorpion_destroyed "damage") (objects_detach scorpion scorpion_destroyed) (object_destroy scorpion) (sleep_until (volume_test_object trigvol scorpion_destroyed)) (object_destroy scorpion_destroyed) )) (object_create_anew scorpion) ) Host check script: (script startup setup (if (!= (unit_get_health check_vehicle) -1) (set is_host true) ) ) check_vehicle - a vehicle in script room that should spawn on all gametypes. Scorpion - a vehicle that should be destroyable trigvol - a trigger volume in script room that has the first vehicle in the scenario (because that's where manually spawned vehicles will respawn) scorpion_destroyed - a destroyed vehicle Put the vehicle that should be destroyable anywhere in the map where you want it to spawn and put destroyed vehicle in the script room inside the trigger volume. Compile scripts and it should work.
|
|
|

Bungie LLC
Joined: Dec 29, 2013
friendly neighborhood contrarian funposter
|
Posted: Nov 22, 2014 11:55 AM
Msg. 5 of 11
Thank you for that. That's a rather good explanation. As for the "Host check script," should that go before the "script example" when putting the syntax in .hsc, or should it go before? Why would the "host check script" be separate from the script example in your post?
|
|
|

altis94
Joined: Oct 5, 2012
Join my Discord https://discord.gg/GDVEaRD
|
Posted: Nov 22, 2014 11:59 AM
Msg. 6 of 11
It should go before script example. It's separate because you only need to check for host once and you can have many destroyable vehicle scrips.
|
|
|

Bungie LLC
Joined: Dec 29, 2013
friendly neighborhood contrarian funposter
|
Posted: Nov 22, 2014 12:05 PM
Msg. 7 of 11
Considering the logic behind this script, this is awfully clever. Even despite pre-set vehicle respawn times (be it 1 minute or none), which is something I was worrying about a little bit, the script will still work properly. Nice work on this, seriously.
EDIT: Also, for those reading in interest besides just myself, my above statement about vehicle respawn times implies that only vehicles themselves can be used as a "destroyed vehicle" candidate, as only vehicles themselves are prone to the vehicle respawn time, and using anything else besides a vehicle (.garbage, .scenery, .device, etc.) will not coincide with the vehicle respawn times for the game.
One last question: in order to create an explosion effect when the vehicle is "destroyed," do you not just set up an effect to play in the destroyed vehicle's "creation effect" field, or is there a better way to do it? I am unsure if creation effects themselves even work over multiplayer, as I have never heard of anyone using them, nor have I ever tried myself. Edited by Bungie LLC on Nov 22, 2014 at 12:07 PM Edited by Bungie LLC on Nov 22, 2014 at 12:09 PM
|
|
|

altis94
Joined: Oct 5, 2012
Join my Discord https://discord.gg/GDVEaRD
|
Posted: Nov 22, 2014 12:16 PM
Msg. 8 of 11
It is a creation effect. There is a way to prevent the destroyed vehicle from respawning if you are interested. Also I forgot to mention that script was made by Kirby.
|
|
|

Bungie LLC
Joined: Dec 29, 2013
friendly neighborhood contrarian funposter
|
Posted: Nov 22, 2014 12:21 PM
Msg. 9 of 11
Interesting. I may not be personally interested (at least not at the moment) in a way in preventing the destroyed vehicle from respawning, but I am sure that there are others out there who would seek out this information that would like to. I'm sure it would be very beneficial to discuss that method too, as well as any other important or interesting methods that go hand-in-hand with this "destructible vehicle" resource. I had assumed that it was either your script or Kirby's, but thanks for clearing that up, I guess.
|
|
|

altis94
Joined: Oct 5, 2012
Join my Discord https://discord.gg/GDVEaRD
|
Posted: Nov 22, 2014 12:32 PM
Msg. 10 of 11
Set maximum body vitality to 1 and on creation effect add an event delayed by 0.05 seconds that will create a small damage effect that does damage to vehicle's material and does 2 damage. That will prevent vehicle from respawning and will remove "press E to flip" message. This could be useful for those who want scenery with physics. In single player it can be used for destroyable vehicle parts so player wouldn't be able to flip them and they could also be destroyed for optimisation by another event in creation effect which would be delayed by 1 minute and would do 500 damage. You would need to set body destroyed treshold to -500 in collision geometry.
|
|
|

Bungie LLC
Joined: Dec 29, 2013
friendly neighborhood contrarian funposter
|
Posted: Nov 22, 2014 12:42 PM
Msg. 11 of 11
Again, very clever. Thank you for sharing this info with the public. I know that I very much appreciate it, as I am sure others will too. EDIT: Running into an issue here. I've set the script up with one vehicle as a test. I have a default mp_warthog as my check_vehicle, a destroyed prowler hull .vehicle as my prowler_destroyed (taking the place of scorpion_destroyed), a trigger volume containing both check_vehicle (the first vehicle placed in the scenario) and the prowler destroyed vehicle, named "trigvol," and a prowler with the name "prowler" as my vehicle that the players use. This was all set up, and I went in and edited my script appropriately. Initially, this is what I came up with: (script startup setup (if (!= (unit_get_health check_vehicle) -1) (set is_host true) ) )
(script continuous prowler_destruction (if (= is_host false) (sleep -1)) (sleep_until (or (= (unit_get_shield prowler) 0) (volume_test_object trigvol prowler))) (if (= (unit_get_shield prowler) 0) (begin (sleep_until (begin (if (!= (list_count (vehicle_riders prowler)) 0) (unit_kill (unit (list_get (vehicle_riders prowler) 0)))) (= (list_count (vehicle_riders prowler)) 0) ) 0 ) (object_create prowler_destroyed) (objects_attach prowler "" prowler_destroyed "engine") (objects_detach prowler prowler_destroyed) (object_destroy prowler) (sleep_until (volume_test_object trigvol prowler_destroyed)) (object_destroy prowler_destroyed) )) (object_create_anew prowler) )Though, upon attempting to compile in sapien, it told me that "is_host" is not "a valid global variable." "11.26.14 23:11:19 [gta_halo line 3] this is not a valid global variable.: is_host true) 11.26.14 23:11:19 recompiling scripts after scenarios were merged. 11.26.14 23:11:19 [gta_halo line 2] this left parenthesis is unmatched.: (if (!= (unit_get_health check_vehicle) -1)" To try and fix this, I went in and added a global value at the very beginning of my script, which seemed to fix the problem, because the script then successfully compiled. (global boolean is_host false)(script startup setup (if (!= (unit_get_health check_vehicle) -1) (set is_host true) ) )
..." Though, once I recompiled the map and went to go see if the fix had worked, nothing happened with my vehicle after taking an extensive amount of damage. I am at a loss as to what to do next to try and fix my issue, and was hoping for some insight. Also, I am an OpenSauce user, and I know that there are some additional scripting interfaces that OpenSauce has in regards to server utilities, such as "machine_is_host" and "machine_is_dedi." ( https://code.google.com/p/open-sauce/wiki/Doc_Halo1_NewScriptInterfaces#MACHINE/SERVER_UTILS) Edited by Bungie LLC on Nov 27, 2014 at 12:20 AM
|
|
|
| |
|
|
 |
|