3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1]

Author Topic: Teleport an object to another object  (Read 171 times)

« on: March 14, 2014, 08:04:25 AM »
Im currently working on an FPS game and so I need the NPC's to die obviously. So in order to do that I should need to teleport a ragdoll to the NPC's position.

Whitch means getting the coordinates of the NPC and then teleporting the ragdoll to those coordinates via script.

How would I do this?
« Reply #1 on: March 15, 2014, 10:49:30 AM »
iObjectLocation() and iObjectLocationSet().
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #2 on: March 15, 2014, 01:08:45 PM »
iObjectLocation() and iObjectLocationSet().

I got "Expected "[" line 3 [pos 35]"

Heres the script.

Quote
void Main()
{
   iObjectLocation(OBJ_330,Vector3);
   iObjectLocationSet(OBJ_0,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_22,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_44,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_66,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_88,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_110,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_132,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_154,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_176,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_198,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_220,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_242,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_264,Vector3(X,Y,Z));
   iObjectLocationSet(OBJ_286,Vector3(X,Y,Z));

   iScriptStop();
}
« Reply #3 on: March 15, 2014, 02:19:14 PM »
Well what did you expect to happen.

Just to be sure, do you have any programming experience what so ever?
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #4 on: March 15, 2014, 03:10:46 PM »
Quote
Whitch means getting the coordinates of the NPC and then teleporting the ragdoll to those coordinates via script.

How would I do this?

you'd do it just the way you said... get the coordinates of the NPC and then teleporting the ragdoll to those coordinates via script... 

but first you've gotta know a lil bit about writing  AngelScript  in 3DRAD...  the script you posted shows that there are a few key concepts that you haven't grasped yet...

take a few minutes and do something similar to what you want to do, but simpler... and go through the scripting tutorials...
you're almost there...

--Mike
« Reply #5 on: March 15, 2014, 04:18:02 PM »
Got it working, I just had to edit the script a little bit.
Pages: [1]