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: The Counter Object  (Read 257 times)

« on: May 14, 2014, 08:58:05 PM »
Hey Guys, I have never used the Counter Object. I'm wanting to collect coins in my new game, I am not sure how to go about doing that. Right Now I have The Player Rigid-body and a Coin skin-mesh attached to an Event on contact (Both Monitored), And Event on contact starts the counter object that is connected to the Value Print (Counter value is the value to PRINT).

But The Value wont go up when I collide the rigidbody with the skinmesh. (I also tryed colliding the rigidbody with another, but that did not work either.

Any Ideas?
« Last Edit: May 14, 2014, 08:59:43 PM by Heat Advisory »
« Reply #1 on: May 14, 2014, 09:19:19 PM »
Why don't you try the event on location instead of event on contact and set the skin mesh as parent.it worked in my game.
« Reply #2 on: May 14, 2014, 09:47:25 PM »
Use an event on location around the skinmesh and detect it that way. EventOnContact won't work unless they both have collision detection.
« Last Edit: May 14, 2014, 09:50:49 PM by MetallicDoom19 »
Using 3D Rad v7.19
Specs:
OS: Windows 7 Home Premium 64-Bit
Processor: AMD Athlon(tm) II X4 640 Processor (4 CPUs), ~3.0GHz
8GB RAM
Graphics: NVIDIA GeForce GTX 550 Ti
DirectX Version: 11
Hard Drive Space: 465 GB
« Reply #3 on: May 15, 2014, 03:38:14 AM »
The above. And don't forget to set an incremental value.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #4 on: May 15, 2014, 10:31:11 AM »
Use an event on location around the skinmesh and detect it that way. EventOnContact won't work unless they both have collision detection.
Ok, this worked, thanks, But What do I do If I want to collect 8 coins? Do I need to use imposters?

I don't want to use 8 event on locations for 8 coins.
« Reply #5 on: May 15, 2014, 10:57:36 AM »

I don't want to use 8 event on locations for 8 coins.

EOLs can be impostered. Check 'EOLImpostersDemo.3dr'.

Of course, the ideal way would be scripting this feature.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #6 on: May 15, 2014, 11:10:00 AM »
I took a look at the demo, That's neat. Now how do I make 10 Locations with 10 skinmeshes? I know I have to plot the points, I'm just not sure If i can do it without a script.
« Reply #7 on: May 20, 2014, 09:18:59 PM »
I found this script that imposters a skinmesh in 5 locations.
Is it possible to put the event on locations in the same place as the skinmesh?
How could I do that?
Code: [Select]
Quaternion q;
void Main()
{
if(iInitializing())
iObjectImpostersCreate(OBJ_0,5);
iQuaternionFromEulerAngles(q,0,0,0,"xyz");
iObjectImposterSet(OBJ_0,0,q,Vector3(-58.509,12.800,-1.018));
iObjectImposterSet(OBJ_0,1,q,Vector3(-18.176,12.800,0));
iObjectImposterSet(OBJ_0,2,q,Vector3(-58.509,12.800,-36));
iObjectImposterSet(OBJ_0,3,q,Vector3(-18.176,12.800,-36));
iObjectImposterSet(OBJ_0,4,q,Vector3(-38,18.800,11.201));
}
« Reply #8 on: May 21, 2014, 02:09:06 AM »
You could just copy the content and use the exact same script for the EOL, that might work.

Important note though: you need to destroy your created imposters at the end of the project by adding this line:

Code: [Select]
if (iDeinitializing()) iObjectImpostersDestroy(OBJ_0);
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #9 on: May 21, 2014, 11:17:16 AM »
Quote
You could just copy the content and use the exact same script for the EOL, that might work.
Ok, that worked.

Is it possible to make each individual coin imposter that is connected to each EOL go away after it is collected?

(Each impostered EOL added one point to the counter  :) )

EDIT: At the moment after I hit the EOL All the impostered Skinmeshes disappear.
« Last Edit: May 21, 2014, 11:29:18 AM by Heat Advisory »
« Reply #10 on: May 21, 2014, 12:09:41 PM »
Is it possible to make each individual coin imposter that is connected to each EOL go away after it is collected?

Not without scripting, no, I don't thinks so. If I'm not mistaken there is no way to check individual EOL imposters.

I would recommend, again, to script the entire feature. Much more efficient and saves loading time.
By doing so, you can completely customize everything to your likings.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #11 on: May 22, 2014, 02:46:53 AM »
Heat, I figured I'd post my reply here. No need to keep this in private, it might be helpful to others.  ;)

I made an example of a scripted coin collecting system. I hope it helps. Commentary is added in the script object. If you have any questions, feel free to ask them.
Rocket Rumble, a 3D Rad puzzle game:
http://www.3drad.com/forum/index.php?topic=9896.0
« Reply #12 on: May 22, 2014, 04:34:21 PM »
Yess, this works great, It's much better to script it seems, I will see what I can learn from this script.

I think you should post the script in the script database http://www.3drad.com/forum/index.php?topic=8232.0 topic for all to use!
Pages: [1]