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

linking clips to script_model

broken avatar :(
Created 11 years ago
by GerardS0406
0 Members and 1 Guest are viewing this topic.
3,269 views
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
Signature
Projects:
Unnamed Project: 5%
Mutliple Downloadable Items for Mappers: (Released after map releases)
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
How to link clips to a script_model.

What I've tried.
Created a script_brushmodel and changed the texture to clip and then made the targetname clip1, clip2 and so on.
Then in my SCRIPT.gsc I put in
Code Snippet
Plaintext
clip1 = getent("clip1", "targetname");
clip1 enablelinkto();
clip1 linkto(SCRIPTMODEL);

Any Help is appreciated
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 5 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Mapper Elite
My Groups
More
My Contact & Social Links
More
Signature
Overrun
Lockdown
Overrun (Black Ops Mod)
Snowglobe
Leviathan
Abandoned School
Ski Resort
Leviathan Redux
×
JBird632's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
That is how you would like something to an object; however, clips seem to disable themselves when they move (or atleast whenever I have attempt having moving clips). Players always seemed to be able to walk right through them :/
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
That is how you would like something to an object; however, clips seem to disable themselves when they move (or atleast whenever I have attempt having moving clips). Players always seemed to be able to walk right through them :/
hmmm... well I'm trying to have like a moving object that you can ride in... any tips
Last Edit: April 04, 2015, 04:06:07 am by GerardS0406
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 5 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
You could like the player to the object, but that will prevent the player from moving, so I don't know if that is something you want.
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
You could like the player to the object, but that will prevent the player from moving, so I don't know if that is something you want.
I have reached a point where I don't know what is wrong... Here is a function of my script and it is saying a bad syntax for players = get_players();
Code Snippet
Plaintext
stick_players()
{
origin1 = getent("origin1", "targetname");
//did origin 2,3,4 after that one ^^
stick_trigger = getent("stick_trigger", "targetname");
players = get_players();
if players[0] isTouching(stick_trigger))
{
players[0] SetOrigin(origin1.origin);
players[0] SetPlayerAngles(origin1.angles);
players[0] PlayerLinkTo (origin1);
}
//did same for player 1,2,3
}
}
}
Last Edit: April 04, 2015, 04:49:13 am by GerardS0406
broken avatar :(
×
broken avatar :(
RadihaX
Location: caCanada
Date Registered: 2 September 2012
Last active: 5 years ago
Posts
978
Respect
Forum Rank
The Decider
Primary Group
Mapper Elite
My Groups
More
My Contact & Social Links
More
×
JBird632's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
UGX V.I.P.
UGX V.I.P.
Mapper Elite Has shown excellence and experience in the area of custom mapping in the UGX-Mods community.
Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
JBird632's Contact & Social LinksJBird632JBird632JBird632JBird632JBird632Mapper
You were missing a parenthesis on your if statement and you had too many brackets.
Code Snippet
Plaintext
stick_players()
{
origin1 = getent("origin1", "targetname");
//did origin 2,3,4 after that one ^^
stick_trigger = getent("stick_trigger", "targetname");
players = get_players();
if( players[0] isTouching(stick_trigger))
{
players[0] SetOrigin(origin1.origin);
players[0] SetPlayerAngles(origin1.angles);
players[0] PlayerLinkTo (origin1);
}
//did same for player 1,2,3
}
Last Edit: April 04, 2015, 05:08:24 am by JBird632
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
If you indented your code you might be able to see what your actually doing. People don't do it because they like hitting the tab/space key you know.   :P

Code Snippet
Plaintext
stick_players()
{
origin1 = getent("origin1", "targetname");
//did origin 2,3,4 after that one ^^
stick_trigger = getent("stick_trigger", "targetname");
players = get_players();
if(players[0] isTouching(stick_trigger))
{
players[0] SetOrigin(origin1.origin);
players[0] SetPlayerAngles(origin1.angles);
players[0] PlayerLinkTo (origin1);
}
//did same for player 1,2,3
}

I suppose its worth mentioning that if you need four different "origins" you should use an array. It'll save you time and it'll be less code.



broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
If you indented your code you might be able to see what your actually doing. People don't do it because they like hitting the tab/space key you know.   :P

Code Snippet
Plaintext
stick_players()
{
origin1 = getent("origin1", "targetname");
//did origin 2,3,4 after that one ^^
stick_trigger = getent("stick_trigger", "targetname");
players = get_players();
if(players[0] isTouching(stick_trigger))
{
players[0] SetOrigin(origin1.origin);
players[0] SetPlayerAngles(origin1.angles);
players[0] PlayerLinkTo (origin1);
}
//did same for player 1,2,3
}

I suppose its worth mentioning that if you need four different "origins" you should use an array. It'll save you time and it'll be less code.
Yes I did do this... Basically what's happening now is the model is moving but the players or origins aren't moving with it... any help?

Here is my full script
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
//How long it will take the Model to reach destination
time = 8;
bus = getentarray("bus", "targetname");
origin1 = getent("origin1", "targetname");
origin2 = getent("origin2", "targetname");
origin3 = getent("origin3", "targetname");
origin4 = getent("origin4", "targetname");
players = get_players();

//Set Up Bus Trigger
bus_trig1 = getEnt("bus1", "targetname");
bus_trig1 setHintString("Press and Hold &&1 to move Bus");
bus_trig1 setCursorHint("HINT_NOICON");
bus_trig1 UseTriggerRequireLookAt();

//Destination Point
dest1 = getEnt("dest1","targetname");

//Control Trigger
for( i = 0; i < bus.size; i++ )
{
bus_trig1 waittill("trigger");
iPrintLn("Bus will move in 10 sec");
origin1 enablelinkto();
origin1 linkto(bus[i]);
origin2 enablelinkto();
origin2 linkto(bus[i]);
origin3 enablelinkto();
origin3 linkto(bus[i]);
origin4 enablelinkto();
origin4 linkto(bus[i]);
wait(7);
iPrintLn("3");
wait(1);
iPrintLn("2");
wait(1);
iPrintLn("1");
thread stick_players();
wait(1);
iPrintLn("Bus is now moving!");
bus[i] moveto (dest1.origin, time);
wait(7);
players[0] Unlink();
players[1] Unlink();
players[2] Unlink();
players[3] Unlink();
}
}
stick_players()
{
origin1 = getent("origin1", "targetname");
origin2 = getent("origin2", "targetname");
origin3 = getent("origin3", "targetname");
origin4 = getent("origin4", "targetname");

stick_trigger = getent("stick_trigger", "targetname");

players = get_players();

if(players[0] isTouching(stick_trigger))
{
players[0] SetOrigin(origin1.origin);
players[0] SetPlayerAngles(origin1.angles);
players[0] PlayerLinkTo (origin1);
}

if(players[1] isTouching(stick_trigger))
{
players[1] SetOrigin(origin2.origin);
players[1] SetPlayerAngles(origin2.angles);
players[1] PlayerLinkTo (origin2);
}

if(players[2] isTouching(stick_trigger))
{
players[2] SetOrigin(origin3.origin);
players[2] SetPlayerAngles(origin3.angles);
players[2] PlayerLinkTo (origin3);
}

if(players[3] isTouching(stick_trigger))
{
players[3] SetOrigin(origin4.origin);
players[3] SetPlayerAngles(origin4.angles);
players[3] PlayerLinkTo (origin4);
}
}

Double Post Merge: April 04, 2015, 07:10:24 am
nvm found my mistake. Thx guys ;)

(it was this:
Code Snippet
Plaintext
origin1 = getentarray("origin1", "targetname");
supposed to be:
Code Snippet
Plaintext
origin1 = getent("origin1", "targetname");
Last Edit: April 04, 2015, 03:13:10 pm by GerardS0406
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Yes I did do this... Basically what's happening now is the model is moving but the players or origins aren't moving with it... any help?

Here is my full script
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

main()
{
//How long it will take the Model to reach destination
time = 8;
bus = getentarray("bus", "targetname");
origin1 = getentarray("origin1", "targetname");
origin2 = getentarray("origin2", "targetname");
origin3 = getentarray("origin3", "targetname");
origin4 = getentarray("origin4", "targetname");
players = get_players();

//Set Up Bus Trigger
bus_trig1 = getEnt("bus1", "targetname");
bus_trig1 setHintString("Press and Hold &&1 to move Bus");
bus_trig1 setCursorHint("HINT_NOICON");
bus_trig1 UseTriggerRequireLookAt();

//Destination Point
dest1 = getEnt("dest1","targetname");

//Control Trigger
for( i = 0; i < bus.size; i++ )
{
bus_trig1 waittill("trigger");
iPrintLn("Bus will move in 10 sec");
origin1 enablelinkto();
origin1 linkto(bus[i]);
origin2 enablelinkto();
origin2 linkto(bus[i]);
origin3 enablelinkto();
origin3 linkto(bus[i]);
origin4 enablelinkto();
origin4 linkto(bus[i]);
wait(7);
iPrintLn("3");
wait(1);
iPrintLn("2");
wait(1);
iPrintLn("1");
thread stick_players();
wait(1);
iPrintLn("Bus is now moving!");
bus[i] moveto (dest1.origin, time);
wait(7);
players[0] Unlink();
players[1] Unlink();
players[2] Unlink();
players[3] Unlink();
}
}
stick_players()
{
origin1 = getent("origin1", "targetname");
origin2 = getent("origin2", "targetname");
origin3 = getent("origin3", "targetname");
origin4 = getent("origin4", "targetname");

stick_trigger = getent("stick_trigger", "targetname");

players = get_players();

if(players[0] isTouching(stick_trigger))
{
players[0] SetOrigin(origin1.origin);
players[0] SetPlayerAngles(origin1.angles);
players[0] PlayerLinkTo (origin1);
}

if(players[1] isTouching(stick_trigger))
{
players[1] SetOrigin(origin2.origin);
players[1] SetPlayerAngles(origin2.angles);
players[1] PlayerLinkTo (origin2);
}

if(players[2] isTouching(stick_trigger))
{
players[2] SetOrigin(origin3.origin);
players[2] SetPlayerAngles(origin3.angles);
players[2] PlayerLinkTo (origin3);
}

if(players[3] isTouching(stick_trigger))
{
players[3] SetOrigin(origin4.origin);
players[3] SetPlayerAngles(origin4.angles);
players[3] PlayerLinkTo (origin4);
}
}

Looks like you don't understand what an array is. Arrays are multiple data types stored in a single variable such as a string, integer, entity, etc.

I would go into a detailed explanation of arrays but its like 4AM here and i'm a little tired. Just think of them as boxes that hold stuff in them(just about always of the same type). The box(array) itself isn't important, its the individual values that make up the array that matters. Your script is basically saying that each individual "origin" is its box when its only that individual entity.

Anyway, based off of the previous script provided, i made a version that properly uses arrays. It should work as long as i didn't screw up somewhere but either way you can use it to better understand arrays and how they work.

Code Snippet
Plaintext
stick_players()
{
origins = getentarray("origins", "targetname");
stick_trigger = getent("stick_trigger", "targetname");

if(!isdefined(origins) || !isdefined(stick_trigger)) // Don't run code if nothing is defined
{
iprintln("No origins or stick trigger defined!");
return;
}
players = get_players();
for(i=0;i<players.size;i++) // Set the brushorigin before moving onto trigger function
{
players[i].brushorigin = origins[i]; // This should set the spot for each player
}
stick_trigger trig_think();
}
trig_think()
{
self sethintstring("Press &&1 to start the ride");
self setCursorHint( "HINT_NOICON" );
who = undefined;
self waittill("trigger", who);
who player_tele();

}
player_tele()
{
self SetOrigin(self.brushorigin.origin);
if(isdefined(self.brushorigin.angles)) // The origin's angles probably aren't defined but if they are this will set them.
{
self SetPlayerAngles(self.brushorigin.angles);
}
self PlayerLinkTo(self.brushorigin);
}
broken avatar :(
×
broken avatar :(
Location: usMissouri
Date Registered: 6 August 2013
Last active: 10 months ago
Posts
513
Respect
Forum Rank
Zombie Enslaver
Primary Group
Member
My Contact & Social Links
More
×
GerardS0406's Groups
GerardS0406's Contact & Social LinksGerardS0406GerardS0406Gerard0406MrGerard0406
Looks like you don't understand what an array is. Arrays are multiple data types stored in a single variable such as a string, integer, entity, etc.

I would go into a detailed explanation of arrays but its like 4AM here and i'm a little tired. Just think of them as boxes that hold stuff in them(just about always of the same type). The box(array) itself isn't important, its the individual values that make up the array that matters. Your script is basically saying that each individual "origin" is its box when its only that individual entity.

Anyway, based off of the previous script provided, i made a version that properly uses arrays. It should work as long as i didn't screw up somewhere but either way you can use it to better understand arrays and how they work.

Code Snippet
Plaintext
stick_players()
{
origins = getentarray("origins", "targetname");
stick_trigger = getent("stick_trigger", "targetname");

if(!isdefined(origins) || !isdefined(stick_trigger)) // Don't run code if nothing is defined
{
iprintln("No origins or stick trigger defined!");
return;
}
players = get_players();
for(i=0;i<players.size;i++) // Set the brushorigin before moving onto trigger function
{
players[i].brushorigin = origins[i]; // This should set the spot for each player
}
stick_trigger trig_think();
}
trig_think()
{
self sethintstring("Press &&1 to start the ride");
self setCursorHint( "HINT_NOICON" );
who = undefined;
self waittill("trigger", who);
who player_tele();

}
player_tele()
{
self SetOrigin(self.brushorigin.origin);
if(isdefined(self.brushorigin.angles)) // The origin's angles probably aren't defined but if they are this will set them.
{
self SetPlayerAngles(self.brushorigin.angles);
}
self PlayerLinkTo(self.brushorigin);
}
Thanks for the Tip
Last Edit: April 04, 2015, 03:10:59 pm by GerardS0406

 
Loading ...