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

How to make something move using script structs?

broken avatar :(
Created 5 years ago
by Chadric273
0 Members and 1 Guest are viewing this topic.
1,621 views
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 months ago
Posts
40
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
Question for you all, how would I go about scripting something so that I can make it move from one script_struct to the next? I know there moveTo functions and such and I tried making them work using a script struct, but I could not get it to work. Anyone that can help me with this?
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 3 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
Signature
My published cod maps:

Subzero
Djinncaves
Enclosed (a.k.a baconcube)
Bayern
Snowblind
Furtrelock

Black Ops Perks: https://www.ugx-mods.com/forum/scripts/55/call-of-duty-world-at-war-black-ops-perks/22180/
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
Question for you all, how would I go about scripting something so that I can make it move from one script_struct to the next? I know there moveTo functions and such and I tried making them work using a script struct, but I could not get it to work. Anyone that can help me with this?
I think there are problems moving structs because they don't have a body (Atleast I couldn't use them). However if you have an entity you are able to move it to a direction.

How to use MoveTo?
Wall = getEnt("walldoor", "targetname");
Wall MoveTo( Wall.origin + (200, 200, 0), time);

This should be the same as in cod waw?
Last Edit: September 12, 2019, 06:54:19 pm by gympie6
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 months ago
Posts
40
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
Chadric273's Groups
Chadric273's Contact & Social Linkschadric.hjellming
I think there are problems moving structs because they don't have a body (Atleast I couldn't use them). However if you have an entity you are able to move it to a direction.

How to use MoveTo?
Wall = getEnt("walldoor", "targetname");
Wall MoveTo( Wall.origin + (200, 200, 0), speed);

This should be the same as in cod waw?
 Hello! Thank you for replying to my post! I don’t think my question was very clear. I was wondering if there was a way so that I could place a script struct in one location, and then place a second script struct in a different location, and then script it so that a different entity moves from the first script struct to the second one.
broken avatar :(
×
broken avatar :(
Location: nl
Date Registered: 20 September 2013
Last active: 3 days ago
Posts
645
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
No code is bug free
×
gympie6's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
gympie6's Contact & Social LinksTheRevenantSkullTeffrieTeffrieGympie5#5971
Hello! Thank you for replying to my post! I don’t think my question was very clear. I was wondering if there was a way so that I could place a script struct in one location, and then place a second script struct in a different location, and then script it so that a different entity moves from the first script struct to the second one.
The solution is almost the same:

PointA = getStruct("pointA", "targetname");
PointB = getStruct("pointA", "targetname");

Boat = getEnt("boat", "targetname");


If you want to use only one point because the boat is already at point A:
Code Snippet
Plaintext
Boat MoveTo( PointB.origin, time); 
If you want to use two points:
Code Snippet
Plaintext
Boat MoveTo( PointA.origin, time); 
wait 1; // If you want to add wait time
Boat MoveTo( PointB.origin, time);
If you want to let the boat to look a specific angle:
Code Snippet
Plaintext
Boat RotateTo( PointA.angles, time );
Boat MoveTo( PointA.origin, time);

wait 1; // If you want to add wait time

Boat RotateTo( PointB.angles, time );
Boat MoveTo( PointB.origin, time);
Last Edit: September 12, 2019, 06:55:15 pm by gympie6

 
Loading ...