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

script_vehicle not reacting to scripts

broken avatar :(
Created 8 years ago
by Centric
0 Members and 1 Guest are viewing this topic.
2,811 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
Signature
Learn by doing, not copy and pasting.

Enjoy my 2015 contest map, a simple map with bo1-bo2 features
http://ugx-mods.com/forum/index.php?topic=14968.msg149200#
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
I decided to try to set up a vehicle for the players to ride in. I followed a tutorial on Mods Respiratory and it works how it should, when I touch a trigger it sets off the vehicle in the set path, however I need to be able to 1. Hide the model until the times comes to show it. 2. link some structs to it. (im linking the structs to it then teleporting the players to the structs) The vehicle doesnt seem to react to scripts, here part of it

Code Snippet
Plaintext
 
veh = GetEnt("veh","targetname");
veh2 = GetEnt("veh2","targetname");
veh Hide();
veh2 Hide();

these are both script_vehicles and they defiantly don't hide. Is there either an easier way to do this or is it just not possible?
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
You can hide and show vehicles and link structs to them so u must have skipped something.
check your kvps. Try deleting them through script to be sure they exist. Add iprintln through the entire script.

any errors when loading your map?
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
You can hide and show vehicles and link structs to them so u must have skipped something.
check your kvps. Try deleting them through script to be sure they exist. Add iprintln through the entire script.

any errors when loading your map?

Map loads fine. Here the kvps on the vehicles, the targetname is fine as you can see :/


This code links it, the print goes through and im moved where im supposed to but its not linking.

Code Snippet
Plaintext
 
structs = getstructarray("player_ride_point","targetname");
players = get_players();
for(i=0;i<players.size;i++)
{
players[i] setorigin( structs[i].origin );
players[i] setplayerangles( structs[i].angles );
structs[i] LinkTo(veh);
IPrintLnBold("linking");
wait 0.1;
}
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
Change the joint names to match the vehicle joints.
Code Snippet
Plaintext
players = get_players();
if( isdefined( players[0] ) )
{
players[0] playerlinktodelta( veh, "tag_passenger2", 1.0, 110, 100, 100, 100);   ///4 tags
}
if( isdefined( players[1] ) )
{
players[1] playerlinktodelta( veh, "tag_passenger1", 1.0, 110, 100, 100, 100);
}
if( isdefined( players[2] ) )
{
players[2] playerlinktodelta( veh, "tag_passenger1", 1.0, 110, 100, 100, 100);
}
if( isdefined( players[3] ) )
{
players[3] playerlinktodelta( veh, "tag_passenger2", 1.0, 110, 100, 100, 100);
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
arent u supposed to use GetVehicleNode or GetVehicleNodeArray to define vehicles? not GetEnt or GetEntArray
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
If its a script_vehicle getent works.
I've never needed getvehiclenode because startpath() makes it move along its connected path.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
Change the joint names to match the vehicle joints.
Code Snippet
Plaintext
players = get_players();
if( isdefined( players[0] ) )
{
players[0] playerlinktodelta( veh, "tag_passenger2", 1.0, 110, 100, 100, 100);   ///4 tags
}
if( isdefined( players[1] ) )
{
players[1] playerlinktodelta( veh, "tag_passenger1", 1.0, 110, 100, 100, 100);
}
if( isdefined( players[2] ) )
{
players[2] playerlinktodelta( veh, "tag_passenger1", 1.0, 110, 100, 100, 100);
}
if( isdefined( players[3] ) )
{
players[3] playerlinktodelta( veh, "tag_passenger2", 1.0, 110, 100, 100, 100);
}

Using this did absolutely nothing. The tags you put in weren't correct for the vehicle so I set them up correctly and nothing either way. My way at least moved the player :/
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
players setorigin( structs.origin );
players setplayerangles( structs.angles );
structs LinkTo(veh);
IPrintLnBold("linking");
wait 0.1;

You forgot to link the players to anything in your code.
//
What I posted works too and enables the players to look around while linked. Its from treyarch code and other people here have used it.
If you don't get any errors loading your map then I don't know what it could be.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 2 years ago
Posts
481
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentricccentric_
players setorigin( structs.origin );
players setplayerangles( structs.angles );
structs LinkTo(veh);
IPrintLnBold("linking");
wait 0.1;

You forgot to link the players to anything in your code.
//
What I posted works too and enables the players to look around while linked. Its from treyarch code and other people here have used it.
If you don't get any errors loading your map then I don't know what it could be.

Right after posting my previous response I realized that and linked the players too, the vehicle just seems to not be responding to anything in my code. Idk why it's not coming up, I'll try a few more things then just do something less cool instead :/
broken avatar :(
×
broken avatar :(
Location: kh
Date Registered: 9 August 2013
Last active: 5 years ago
Posts
503
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
×
codmoddd1234's Groups
codmoddd1234's Contact & Social Links
Not sure why my last post was italics.
I sent you a pm.
You can update this topic with a solution when we fix it.

 
Loading ...