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: Enemy scanner  (Read 112 times)

« on: May 23, 2014, 08:22:24 AM »
Hi.

my game is like Crash (Playstation 1 Game) or Mario Kart Game. I want my enemy car could scan 4 rigidbody and randomize collide to One of the four rigidbody.
can anyone help me?

Thanks.
« Last Edit: May 23, 2014, 09:22:22 AM by behdadsoft »
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #1 on: May 23, 2014, 09:20:37 AM »
or after collide to One of the four rigidbody, change 4 picture and show random one.

like this topic: http://www.3drad.com/forum/index.php?topic=10439.0

I made it with number but I don't know how can make it with pictures.

Code: [Select]
// OUT_0 = Counter Object
int count = 0;
void Main()
{

   if (count < 200)
   {
      iPrint ("count :" + count, 8,10, OBJ_132);
      OUT_0 = iFloatRand (0,4);
      count++;
   }

   if (count == 200)
   {
      iObjectStop(OBJ_0); // Stop Counter Object
   }

}


« Last Edit: May 23, 2014, 10:29:12 AM by behdadsoft »
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #2 on: May 23, 2014, 11:02:18 AM »
I made it with Picture but there is a Problem. I want when OUT_0 (Counter) is between (1-4) show current page. mean if (OUT_0 == 1) Show Picture 1 and so on.
but don't work good.I attached my Project.

Thanks A Lot
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
« Reply #3 on: May 23, 2014, 09:31:56 PM »
Hi B........ I have put some comments in your code. Frankly its a mess .

When you wright a script look at each line to see what it does how it effect the next line and what values you are looking for, look at the next then the next, when you get to the end start at the top and go through it again just as the computer would and you will see if it makes any sense.
If it doesn't make sense then it wrong the computer is not going to make sense of it if you can't.

Script writing can be very difficult but most of us check our code this way.

n_iron




Code: [Select]
void Main()
{

   if (count < 200)
   {
      iPrint ("count :" + count, 8,10, OBJ_132);

      iObjectShow (OBJ_44);
      iObjectShow (OBJ_66);
      iObjectShow (OBJ_88);
      iObjectShow (OBJ_110);

      OUT_44 = iFloatRand (0,5); // Opacity Sprite 1
      OUT_66 = iFloatRand (0,2); // Opacity Sprite 2
      OUT_88 = iFloatRand (0,3); // Opacity Sprite 3
      OUT_110 = iFloatRand (0,4); // Opacity Sprite 4

      OUT_0 = iFloatRand (0,4); // Counter Object

      count++; // why are you counting here and your using the count object
   }

   if (count == 200)
   {
      iObjectStop(OBJ_0);  // Stop Counter Object
   }

   // Show Sprite 1
   if (OUT_0 == 1) // shouldn't this be IN_0 you can't read OUT_## same as the following lines
   {
      iObjectHide (OBJ_66);
      iObjectHide (OBJ_88);
      iObjectHide (OBJ_110);
   }

   // Show Sprite 2
   if (OUT_0 == 2)
   {
      iObjectHide (OBJ_44);
      iObjectHide (OBJ_88);
      iObjectHide (OBJ_110);
   }
     
   // Show Sprite 3
   if (OUT_0 == 3)
   {
      iObjectHide (OBJ_44);
      iObjectHide (OBJ_66);
      iObjectHide (OBJ_110);
   }

   // Show Sprite 4
   if (OUT_0 == 4)
   {
      iObjectHide (OBJ_44);
      iObjectHide (OBJ_66);
      iObjectHide (OBJ_88);
   }
}
« Reply #4 on: May 23, 2014, 11:19:06 PM »
Thanks n_iron.  :)

anyone can help me fix this Problem?
My Game : Star Wars 1.0

http://behdadgame.com/index.php?topic=3.0

possible way, if we found will make a way.
Pages: [1]