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: Following Zombie Once seen  (Read 1399 times)

« on: September 24, 2012, 11:03:24 PM »
dont let him see you!  :)

http://www.youtube.com/watch?v=poJKgKjlHKM
Roblox username: COMMANDERREX12345345
« Reply #1 on: September 25, 2012, 09:31:35 AM »
Really cool and all, but I just can't figure it out. Why did you use this script:

Code: [Select]
int ObstacleCount;
void Main()
{
   Vector3 pickLocation;
   Vector3 closestPickLocation;
   float distance;
   float minimumDistance;
   int closestObject;
   if (iInitializing())
   {
      ObstacleCount = iObjectHandle(-1);
      OUT_46 = 1.0f; //set character to permanent move-forward state
   }
   //check if the terrain or any obstacle object was picked
   closestObject = -1;
   minimumDistance = 100000000000.0f;
   for (int i=2;i<ObstacleCount;i++)
   {
      distance = iObjectPicked(iObjectHandle(i),pickLocation);
      if ((distance >= 0) && (distance < minimumDistance))
      {
         //this object was picked and the pick location is
         //the closest to the camera so far. Record it
         minimumDistance = distance;
         closestPickLocation = pickLocation;
         closestObject = iObjectHandle(i);
      }
   }
   //if the terrain or any obstacle was picked, place the goal (PathFinder object) there
   if (closestObject >= 0)
   {
      closestPickLocation.y += 1.0f;
      iObjectLocationSet(OBJ_22,closestPickLocation);
   }
}

It seems to be in no way relevant with what the project does.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #2 on: September 25, 2012, 11:30:12 AM »
Really cool and all, but I just can't figure it out. Why did you use this script:

Code: [Select]
int ObstacleCount;
void Main()
{
   Vector3 pickLocation;
   Vector3 closestPickLocation;
   float distance;
   float minimumDistance;
   int closestObject;
   if (iInitializing())
   {
      ObstacleCount = iObjectHandle(-1);
      OUT_46 = 1.0f; //set character to permanent move-forward state
   }
   //check if the terrain or any obstacle object was picked
   closestObject = -1;
   minimumDistance = 100000000000.0f;
   for (int i=2;i<ObstacleCount;i++)
   {
      distance = iObjectPicked(iObjectHandle(i),pickLocation);
      if ((distance >= 0) && (distance < minimumDistance))
      {
         //this object was picked and the pick location is
         //the closest to the camera so far. Record it
         minimumDistance = distance;
         closestPickLocation = pickLocation;
         closestObject = iObjectHandle(i);
      }
   }
   //if the terrain or any obstacle was picked, place the goal (PathFinder object) there
   if (closestObject >= 0)
   {
      closestPickLocation.y += 1.0f;
      iObjectLocationSet(OBJ_22,closestPickLocation);
   }
}

It seems to be in no way relevant with what the project does.

I think thats the default pathfinder script used in the pathfinder demo.
New 3DFoundry:3DFoundry.tk
« Reply #3 on: September 25, 2012, 12:02:59 PM »
...

There is no 'default pathfinder script'. The pathfinder works on it's own.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #4 on: September 25, 2012, 01:45:49 PM »
delete the script. and the pathfinder wont work

http://www.youtube.com/watch?v=poJKgKjlHKM
Roblox username: COMMANDERREX12345345
« Reply #5 on: September 25, 2012, 01:58:53 PM »
delete the script. and the pathfinder wont work

That's true ;) :D . BUT...
« Last Edit: September 25, 2012, 02:28:45 PM by PlayDasher »
New 3DFoundry:3DFoundry.tk
« Reply #6 on: September 25, 2012, 02:02:58 PM »
*sign*

Who is the one who can script here?

This script searches for object linked to it and it places the pathfinder target at the spot you click on with the mouse.

The pathfinder does work when you delete the script, it's the character object which 'doesn't work'.
You need to set a speed to the character object before it works.

You can also use this script:
Code: [Select]
void Main()
{
   OUT_2 = 1;
}
...Where OUT_2 is the forward speed.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0

psikoT

« Reply #7 on: September 25, 2012, 02:10:29 PM »
noobs vs master... ;D funny!

those kids put scripts here and there with no idea about what it does...
« Reply #8 on: September 25, 2012, 02:27:49 PM »
*sign*

Who is the one who can script here?

This script searches for object linked to it and it places the pathfinder target at the spot you click on with the mouse.

The pathfinder does work when you delete the script, it's the character object which 'doesn't work'.
You need to set a speed to the character object before it works.

You can also use this script:
Code: [Select]
void Main()
{
   OUT_2 = 1;
}
...Where OUT_2 is the forward speed.
Thats what is states here:

Code: [Select]
//if the terrain or any obstacle was picked, place the goal (PathFinder object) there
What i trying to do was only to clarify for epikhbk1 in this post:
Really cool and all, but I just can't figure it out. Why did you use this script:

Code: [Select]
int ObstacleCount;
void Main()
{
   Vector3 pickLocation;
   Vector3 closestPickLocation;
   float distance;
   float minimumDistance;
   int closestObject;
   if (iInitializing())
   {
      ObstacleCount = iObjectHandle(-1);
      OUT_46 = 1.0f; //set character to permanent move-forward state
   }
   //check if the terrain or any obstacle object was picked
   closestObject = -1;
   minimumDistance = 100000000000.0f;
   for (int i=2;i<ObstacleCount;i++)
   {
      distance = iObjectPicked(iObjectHandle(i),pickLocation);
      if ((distance >= 0) && (distance < minimumDistance))
      {
         //this object was picked and the pick location is
         //the closest to the camera so far. Record it
         minimumDistance = distance;
         closestPickLocation = pickLocation;
         closestObject = iObjectHandle(i);
      }
   }
   //if the terrain or any obstacle was picked, place the goal (PathFinder object) there
   if (closestObject >= 0)
   {
      closestPickLocation.y += 1.0f;
      iObjectLocationSet(OBJ_22,closestPickLocation);
   }
}

It seems to be in no way relevant with what the project does.
;D
New 3DFoundry:3DFoundry.tk
« Reply #9 on: September 25, 2012, 03:17:56 PM »
noobs vs master... ;D funny!

those kids put scripts here and there with no idea about what it does...

look. all i did was edit the pathfinder demo and made my zombie follow addon and the script was there.
ps( im a very limited angelscripter. lua is all mine.

http://www.youtube.com/watch?v=poJKgKjlHKM
Roblox username: COMMANDERREX12345345

secondry2

« Reply #10 on: November 10, 2012, 12:04:19 AM »
*sign*

Who is the one who can script here?

This script searches for object linked to it and it places the pathfinder target at the spot you click on with the mouse.

The pathfinder does work when you delete the script, it's the character object which 'doesn't work'.
You need to set a speed to the character object before it works.

You can also use this script:
Code: [Select]
void Main()
{
   OUT_2 = 1;
}
...Where OUT_2 is the forward speed.
pwn3d lol
Pages: [1]