UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Adding projectiles to a map, using vehicles

broken avatar :(
Created 8 years ago
by Koan
0 Members and 1 Guest are viewing this topic.
4,042 views
broken avatar :(
×
broken avatar :(
Location: kp
Date Registered: 29 July 2015
Last active: 5 years ago
Posts
435
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
children should not be playing call of duty
Signature
⠀⠀⠀⣴⣴⡤
⠀⣠⠀⢿⠇⡇⠀⠀⠀⠀⠀⠀⠀⢰⢷⡗
⠀⢶⢽⠿⣗⠀⠀⠀⠀⠀⠀⠀⠀⣼⡧⠂⠀⠀⣼⣷⡆
⠀⠀⣾⢶⠐⣱⠀⠀⠀⠀⠀⣤⣜⣻⣧⣲⣦⠤⣧⣿⠶
⠀⢀⣿⣿⣇⠀⠀⠀⠀⠀⠀⠛⠿⣿⣿⣷⣤⣄⡹⣿⣷
⠀⢸⣿⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⢿⣿⣿⣿⣿⣿
⠀⠿⠃⠈⠿⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠹⠿⠿⠿

⠀⢀⢀⡀⠀⢀⣤⠀⠀⠀⠀⠀⠀⠀⡀⡀
⠀⣿⡟⡇⠀⠭⡋⠅⠀⠀⠀⠀⠀⢰⣟⢿
⠀⣹⡌⠀⠀⣨⣾⣷⣄⠀⠀⠀⠀⢈⠔⠌
⠰⣷⣿⡀⢐⢿⣿⣿⢻⠀⠀⠀⢠⣿⡿⡤⣴⠄⢀⣀⡀
⠘⣿⣿⠂⠈⢸⣿⣿⣸⠀⠀⠀⢘⣿⣿⣀⡠⣠⣺⣿⣷
⠀⣿⣿⡆⠀⢸⣿⣿⣾⡇⠀⣿⣿⣿⣿⣿⣗⣻⡻⠿⠁
⠀⣿⣿⡇⠀⢸⣿⣿⡇⠀⠀⠉⠉⠉⠉⠉⠉⠁
×
Koan's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Oil Rig Beta Access
Oil Rig Beta Access
Koan's Contact & Social Linksh-r_Koan_my website
Apologies for the poor quality gif, couldn't get ShadowPlay to work:



Credit to codmoddd1234 who sent me the bulk of this stuff, I adapted it into a tutorial with his permission.


Step 1

Right click in Radiant, go to script > vehicle. Give it the following key-value pairs:
Code Snippet
Plaintext
 targetname | veh_projectile
vehicletype | rubber_raft
      model | <any_xmodel>
You can use any xmodel. The rubber_raft vehicletype allegedly makes better curves, according to codmoddd.



Step 2

Right click in Radiant, go to info > vehicle > node_rotate. The node_rotate means the vehicle will follow a curve; if you want straight lines, select node instead of node_rotate, you can also use combinations of both.
Deselect everything. Select the vehicle, then the node_rotate, then press W to connect them.



Give it the following key-value pairs:
Code Snippet
Plaintext
spawnflags | 1
     speed | 80
 lookahead | .5
Play around with the speed and lookahead settings later as you wish.



Step 3

Place another node_rotate or node (or copy previous one, but if you copy it remember to remove spawnflags KVP from new nodes). Deselect everything, select the first node, then the new node, press W to connect.

Repeat this step until you have the path you want. As you place new nodes, you will see a red curve appear between the first and last nodes (select any node to see it). This is the path the vehicle will follow.





Step 4

Make a new script, call it setupvehicles.gsc, with this code:
Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_vehicle;
#include maps\_anim;
#using_animtree("generic_human");

setupvehicles_preload()
{
build_acustom_vehicle( "rubber_raft" );
}

build_acustom_vehicle( type )
{
model = undefined;
death_model = undefined;
death_fx = "explosions/large_vehicle_explosion";
death_sound = "explo_metal_rand";
health = 1234;
min_health = 1233;
max_health = 1235;
team = "axis";
turretType = undefined;
turretModel = undefined;
func = ::blankpointerfunction;  //vehicle.gsc needs this for nothing

if( type == "rubber_raft" )
{
model = "makin_raft_rubber";  //boat steers different than jeep
death_fx = undefined;
death_model = "makin_raft_rubber";
health = 1234;
min_health = 1233;
max_health = 1235;
team = "allies";
func = ::blankpointerfunction; //vehicle.gsc needs this for nothing
}

maps\_vehicle::build_template( type, model );
maps\_vehicle::build_life( health, min_health, max_health );
maps\_vehicle::build_treadfx();
maps\_vehicle::build_team( team );
maps\_vehicle::build_localinit( func ); 
}

blankpointerfunction()
{
}

With regards to the above script...
I don't actually know how much of this is needed, but just to be on the safe side I've included everything codmoddd included.

In your mapname.gsc, BEFORE the line maps\_zombiemode::main();, add:
Code Snippet
Plaintext
maps\setupvehicles::setupvehicles_preload();



Step 5

Add this function at the bottom of your mapname.gsc:
Code Snippet
Plaintext
launch_boat()
{
veh = getent("veh_projectile", "targetname");

if(!isDefined(veh))
return;

start_vehnode = getvehiclenode( veh.target, "targetname" );  //first nodes in path

while(1)
{
veh attachPath( start_vehnode );
veh StartPath();
veh waittill("reached_end_node");
}
}

IMPORTANT:
While testing this I had launch_boat() set to start whenever I press P, by using BluntStuffy's tutorial here. When including it in a map properly, you will need to either: add a line such as thread launch_boat(); after zombiemode::main() is called, or add a function that wait for a trigger then remove the while loop, or waits for some other event... you get the idea - this is a basic function for you to modify, not a drag-and-drop feature.



Step 6

Add this to your mapname_patch.csv:
Code Snippet
Plaintext
rawfile,vehicles/rubber_raft



Step 7

Compile, build mod after ticking new things (e.g. script), run game.



Please reply/let me know of any issues.
broken avatar :(
×
broken avatar :(
Location: ca
Date Registered: 16 January 2015
Last active: 1 year ago
Posts
127
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Lets have a good blasting time
Signature
The good, it's the bad, and the in-between.
×
NateTheGreat987's Contact & Social LinksCap_FlareCappaFlareGunCapFlareGun
Sweeeet!!!
broken avatar :(
×
broken avatar :(
Location: rusiberia
Date Registered: 26 June 2016
Last active: 4 days ago
Posts
155
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Do I look like a Fcking magician?
Signature
A.K.A IamBEAR
×
IamTIMMEHHH's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
IamTIMMEHHH's Contact & Social LinksIamTIMMEHHH#IamBEAR
nice!
Last Edit: May 08, 2017, 06:31:41 pm by IamTIMMEHHH

 
Loading ...