UGX-Mods

Call of Duty: Black Ops 1 => Help Desk => Scripting => Topic started by: Chadric273 on September 10, 2019, 06:02:56 pm

Title: How to make something move using script structs?
Post by: Chadric273 on September 10, 2019, 06:02:56 pm
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?
Title: Re: How to make something move using script structs?
Post by: gympie6 on September 11, 2019, 04:23:21 am
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?
Title: Re: How to make something move using script structs?
Post by: Chadric273 on September 11, 2019, 01:36:49 pm
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.
Title: Re: How to make something move using script structs?
Post by: gympie6 on September 12, 2019, 06:53:46 pm
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);