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

Car Ride

HOT
broken avatar :(
Created 10 years ago
by jjbradman
0 Members and 1 Guest are viewing this topic.
6,449 views
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
first of all thanks to yaPh1l and BluntStuffy for the help :)
create one gsc in your maps folder called:
Code Snippet
Plaintext
car_run.gsc
and put this inside:

Code Snippet
Plaintext
#include common_scripts\utility; 
#include maps\_utility;
#include maps\_zombiemode_utility;

car_run_trig()
{
thread bomb_run();
}

bomb_run()
{
zombie_cost = 3500;
trigger = getEnt("car_run_trig","targetname");
trigger setHintString("need to turn on power");
trigger SetCursorHint( "HINT_NOICON" );

flag_wait("electricity_on");

wait 1;

while(1)
{
//players = getplayers();
plane = getEnt("car","targetname");
plane_path = GetVehicleNode("car_path_start","targetname");
trigger setCursorHint("HINT_NOICON");
trigger setHintString("Press &&1 to ride jeep [Cost: "+zombie_cost+"]");

trigger waittill("trigger",player);

if(player.score >= zombie_cost)
{
player maps\_zombiemode_score::minus_to_player_score( zombie_cost );
trigger setHintString("Please wait, Jeep is in Use");

plane AttachPath( plane_path );
plane thread maps\_vehicle::vehicle_paths(plane_path);
maps\_vehicle::vehicle_init(plane);
thread reason( plane, plane_path, trigger );
//plane StartPath( plane_path );
wait 50;
}
}
}

reason( plane, plane_path, trigger )
{
tag1 = plane gettagorigin( "tag_driver" );
tag2 = plane gettagorigin( "tag_passenger" );
tag3 = plane gettagorigin( "tag_passenger2" );
tag4 = plane gettagorigin( "tag_passenger3" );
multiple1 = getEnt("multiples123","targetname");
players_touching = get_players_touching( multiple1 );
        for(i=0;i<players_touching.size;i++)
{
        players_gun = players_touching[i] GetCurrentWeapon();       
players_touching[i] PlayerLinkTo( plane, "tag_driver", 1.0 );
        players_touching[i] giveWeapon("tesla_gun");
        players_touching[i] SwitchToWeapon("tesla_gun");
        players_touching[i] DisableWeaponCycling();
        players_touching[i] EnableInvulnerability();

        plane StartPath( plane_path );

wait 20;

        players_touching[i] Unlink();
    players_touching[i] takeweapon("tesla_gun");
    players_touching[i] SwitchToWeapon(players_gun);
    players_touching[i] EnableWeaponCycling();
    players_touching[i] DisableInvulnerability();

    trigger setHintString("Jeep is Refueling");

        wait 30; //TIME IT WILL WAIT TO REFUEL THE JEEP

        thread bomb_run();

}

}

get_players_touching( ent )
{
p= get_players();
array = [];
for(i=0;i<p.size;i++)
{
if(p[i] IsTouching(ent) && is_player_valid(p[i]) )
{
array[array.size] = p[i];
//iPrintLn("it is defined ^1" + p[i].playername);
return array;
}
}
}

and add

Code Snippet
Plaintext
 thread maps\car_run::car_run_trig();

after

Code Snippet
Plaintext
maps\_zombiemode::main();

in your_map_name.gsc

note: inside car_run.gsc you can change the
Code Snippet
Plaintext
wait 30;
to change the time it will take to refuel the car

and the
Code Snippet
Plaintext
wait 10;
must be changed to the exact time it the jeep will take in making all its run

in

Code Snippet
Plaintext
zombie_cost = 3500;
you can adjust the price you want to give it

then in radiant you must know how to make vehicle path because you must know how to change the prefab to fit your map, so if you need any help take a look at ugx airstrike tut on the wiki http://ugx-mods.com/wiki/index.php?title=Airstrike

put this prefab in you map_source folder

https://www.mediafire.com/?yd4cxl8zn7z314c

and put in your map(remmber to do obvious things like making your own vehicle path and removing the brush(the floor) inside the prefab lol )

and done! :D just change the vehicle path to your needs and remember to put the last node in the same place of the start node :)

credits:
bamskater for the chopper script which helped a lot
ugx for the aistrike tutorial xD
Last Edit: March 08, 2014, 10:15:00 pm by jjbradman
broken avatar :(
×
broken avatar :(
Relentless Mapper
Location: al
Date Registered: 21 August 2011
Last active: 3 weeks ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
Nuclear
My Groups
More
×
KDXDARK's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Nuclear
Nuclear
DARKLEGION's requested title
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
KDXDARK's Contact & Social Links
you can post a video or a screenshot?
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
you can post a video or a screenshot?

my internet is slow so it takes me forever to upload a vid xc and my vids would be 10 secs because of fraps >xC i've done enough testing :) but it you can test it and uplaod a vid it would be very nice
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(
Works great thanks man :D
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
Works great thanks man :D
im glad to hear that :D its my first script done by myself(obviously with some help  :lol: ) but im proud of it :'3
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Yes! I have tried to make a script like this to work with the path for the vehicle like this and now you make one for us all, thank you.

In my case when I will use this I have an ai sitting in the car so is it a bit different to make an ai to work with this?
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
Yes! I have tried to make a script like this to work with the path for the vehicle like this and now you make one for us all, thank you.

In my case when I will use this I have an ai sitting in the car so is it a bit different to make an ai to work with this?

if you put an ai then you will have to change my player sitting possittions(so theres no player inside the driver) . but putting the ai it isnt hard, look here http://wiki.modsrepository.com/index.php?title=Call_of_Duty_5:_SP_-_Vehicle_Implementation
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
Yes I know I have already made a vehicle path with an ai in a jeep already. The only thing I needed was a script like this, and then I found this. So I try to make so the player at the driver seat is sitting at the back of the jeep somehow.

Thanks again, you saved me lots of time!
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
Yes I know I have already made a vehicle path with an ai in a jeep already. The only thing I needed was a script like this, and then I found this. So I try to make so the player at the driver seat is sitting at the back of the jeep somehow.

Thanks again, you saved me lots of time!

i would change the script for you but theres only 4 player tag seats in the jeep :(
no problem :)
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
the script had some bugs, that now are finally fixed :s lol so....Topic Updated :D lol
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 8 January 2014
Last active: 6 years ago
Posts
840
Respect
Forum Rank
The Decider
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Personal Quote
Embers are the new lens flares
×
chromastone10's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
chromastone10's Contact & Social Linkschromastone10chromastone1chromastone10
Hey, I was wondering if you would like to help me, I was hoping you could help me make the tranzit bus (except instead of a bus model it's a train), if you are interested in helping you can add me on steam: chromastone10  or skype: chromastone10    (If you do help I may be able to trade you some things, also you obviously get credit and early access to the map :) )
Last Edit: March 09, 2014, 08:45:39 pm by chromastone10
broken avatar :(
×
broken avatar :(
drago
Location: mx
Date Registered: 5 July 2013
Last active: 4 years ago
Posts
941
Respect
Forum Rank
The Decider
Primary Group
Member
My Contact & Social Links
More
×
jjbradman's Groups
jjbradman's Contact & Social Linksjjbradmanjjbradmanjjbradman
i dont think its possible to do the tranzit bus :/ it was already a topic about that, but maybe it is posible o.O pm me and i'll tell you an idea i have  ;)
broken avatar :(
×
broken avatar :(
Location: gbUnited Kingdom
Date Registered: 1 March 2014
Last active: 8 years ago
Posts
26
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
MrCallumKing's Groups
MrCallumKing's Contact & Social LinksMrCallumKing@MrCallumKing
I'm going to keep this aside and maybe use it in a future map  :)
broken avatar :(
×
broken avatar :(
Location: se
Date Registered: 30 July 2013
Last active: 3 weeks ago
Posts
517
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
Ege115's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Ege115's Contact & Social LinksEge115
What if I want the vehicle to stop at a node after you hit the trigger, and then if you hit an another trigger after it stopped at the node, the jeep will continue the path it stopped at?

Which functions would be required in that case?
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 9 months ago
Posts
5,551
Respect
6,691Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
You should look at the vehicle scripts from the campaign missions, thats where I learned all of that stuff.

 
Loading ...