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: 2 attach gun-Guide Me  (Read 228 times)

« on: April 18, 2014, 12:52:33 AM »
Hi.

I want when the car contact with rigidbody show left gun in left side of the car and when contact again show right gun in right side of the car. I can show left and right guns, but I want show right gun after second contact. mean when left gun is shown and the car again contact to rigidbody show right gun. But I don't know how to do it.

I attached a script to EventOnContact and start it when the car collide with rigidbody and show left gun.
if should use counter Object Please Explain more.

Please Guide Me.

Thanks.
« Last Edit: April 18, 2014, 12:55:35 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: April 18, 2014, 03:53:10 AM »
if your doing it without scripting you could maybe do it like this.

have a counter recording the number of collisions the car, have some event on values set up so when the counter reaches the said numbers it hide/shows or starts/stops the gun.

would that do what you need ?
« Reply #2 on: April 18, 2014, 04:23:17 AM »
for more Explanation:

I use this script for set LeftGun = 1 and shoot bullets. and work very well.

Code: [Select]
if (LeftGun==0 && (RightGun==0 || RightGun==1) && IN_88>0 && LeftGatling==0)

   {
      LeftGun = 1;
      LeftGatling = 1;
   }

   // Fire Control if LeftGatling == 1
   if (LeftGatling == 1)
{

// Other Script for shoot bullets

}
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: April 18, 2014, 05:01:46 AM »
If you look into the older posts you will find a lot of code which does rather exact what you need. But you must have the ambition to do that.
To fit this code into your program is your job as game developer. Otherwise - if you are not able to do it - you shall not try to develop games as programmer, but start a carreer as Gameproducer. Pay a reasonable amount of cash to hire programmers and start from there.
To ask for each simple piece of code in a forum may be the wrong way to start game development ... especially if you ask for things which you must learn on your own anyway to understand how they work. Starting game programming is for most a try and error business, until they learn how to program certain things. There is never one way. Its your job as a programmer to find out your way to solve the problems and produce a game others may like. It's not the task of the forum members to write your code.
As long as you have nothing done yourself (and the code above is only 0.0001% above Zero) you cannot expect, that someone does it for you. People will help if you have code with an error you cannot find yourself. But they will not write your program, by providing code you need and cannot program yourself.


Using 3D Rad 7.22
« Reply #4 on: April 18, 2014, 11:56:59 AM »
I don't need script, I need guide how can count contact. ???

I use this code for change Rightgun value to 1 after second contact but work when first contact is true. even I used a new boolean var for check second contact but I did not succeed. :(

Code: [Select]
if (LeftGun==0 && LeftGatling==0 && (RightGun==0 || RightGun==1) && IN_88>0)

 {
    LeftGun = 1;
    LeftGatling = 1;
 }

else if (LeftGun == 1 && RightGun == 0 && RightGatling == 0 && IN_88 > 0)
 {
    RightGun = 1;
    RightGatling = 1;
 }

I think have Problem in some basic Programming and need guide to solve this Problem. :-X
« Last Edit: April 18, 2014, 11:59:13 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 #5 on: April 25, 2014, 06:49:32 AM »
In EventOnContact set both the guns to Show/Hide Switch
--Sam
Pages: [1]