How to make something move using script structs?

broken avatar :(
Created 5 days ago
by Chadric273
0 Members and 1 Guest are viewing this topic.
61 views
broken avatar :(
×
broken avatar :(
Location: Minnesota
Date Registered: 7 July 2012
Last active: 5 days ago
Posts
25
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
338
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
×
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 LinksDistenc5Teffrie
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 days ago
Posts
25
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
338
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
I love skulls
×
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 LinksDistenc5Teffrie
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:
Boat MoveTo( PointB.origin, time); 
If you want to use two points:
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:
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

 

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 Twitch
Loading ...