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 Definitive Scripted Jump!  (Read 2723 times)

« on: December 17, 2011, 09:09:29 PM »
There are a lot of character Jumping Scripts on the forum lately,  I figured I would add the one I have spent the evening working on.

In the declaration section of the script add the int for "Jumping" and floats for the timers. OBJ 44 is the velocity object.. I set mine to about 18 for the character with decent results.  If you need more power than that in your Jumps, you should extend the jumpTimer3 Limit on the last line out accordingly to prevent super jumping...

Enjoy!

Code: [Select]
if (iKeyDown(iKeyCode("DIK_SPACE"))&&jumpTimer<=0.01) 
   {Jumping=1;
    jumpTimer+=0.016667;
    jumpTimer3=0;
                    }
if (Jumping==1&&jumpTimer>=0.01){iObjectStart(OBJ_44); Jumping=0;jumpTimer2+=0.016667;}
if (jumpTimer2>=0.01) jumpTimer3+=0.016667;   
if (jumpTimer3>=2){ jumpTimer=0; jumpTimer2=0;   } 
« Reply #1 on: December 17, 2011, 09:28:23 PM »

In the declaration section of the script add the int for "Jumping" and floats for the timers. OBJ 44 is the velocity object.. I set mine to about 18 for the character with decent results.  If you need more power than that in your Jumps, you should extend the jumpTimer3 Limit on the last line out accordingly to prevent super jumping...


Here is the edited version for those who are lazy
Code: [Select]
float jumpTimer2 =0;
float jumpTimer3 =0;
float jumpTimer =0;

int Jumping;

void Main()
{

if (iKeyDown(iKeyCode("DIK_SPACE"))&&jumpTimer<=0.01)
   {Jumping=1;
    jumpTimer+=0.016667;
    jumpTimer3=0;
                    }
if (Jumping==1&&jumpTimer>=0.01){iObjectStart(OBJ_0); Jumping=0;jumpTimer2+=0.016667;}
if (jumpTimer2>=0.01) jumpTimer3+=0.016667;   
if (jumpTimer3>=2){ jumpTimer=0; jumpTimer2=0;   }  }
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 #2 on: December 18, 2011, 02:07:20 PM »
thanks DM!  The reason I don't post it like that is because I like to combine these script snippets into larger scripts.  I'm going to actually begin experimenting with a jumping code that requires absolutely no physics objects like velocity or force.
« Reply #3 on: December 18, 2011, 03:22:20 PM »
thanks DM!  The reason I don't post it like that is because I like to combine these script snippets into larger scripts.  I'm going to actually begin experimenting with a jumping code that requires absolutely no physics objects like velocity or force.

holly **** man :D how are you going to do that? that would be geniusly cool and i think PRETTY EPIC SIMPLE right? nahi think you need super knowlage to do that but still this is an excelent idea :D
::=::Look at this ::=::
Rally game

The most important thing that happens, you usualy miss it , but after sometime you will remember
 
even if you didint noticed. Go forward and never look back
« Reply #4 on: December 19, 2011, 06:29:28 PM »
Well My idea for a resource-less Jump ran into a little hitch.  My idea was to use iObjectLocationSet/Get to introduce an offset to the x axis, which would be applied when the character jumped... It didn't create the "slingshot" (I could swear that I accidentally created this effect before...???) inertia effect that I had expected and instead just transported and dropped the character from the x location.  I suppose it might work as an alternative still, but it's not as fluid as the script that I already posted.  Therefore I won't  be bothered to post it.
« Reply #5 on: December 19, 2011, 08:55:12 PM »
I believe to not use the character object and instead have a fully scripted character and use the velocity object with an event on contact with the char and floor rigidbody.

Code: [Select]
if(IN_88>=1) //"EVENTONCONTACT" the rest wont run if there is no contact
if (iKeyDown(iKeyCode("DIK_SPACE")))
   {
   iObjectStart(OBJ_66); // Velocity start
   }

else
{
bool AG1 = false;
bool AG2 = true;
float DAMP = 1;
iObjectDampingApply(MESH,DAMP,DAMP,DAMP,AG1,AG2); //Damps when touching ground
}
« Last Edit: December 19, 2011, 09:06:41 PM by CronoBJS »

jestermon

« Reply #6 on: December 20, 2011, 01:12:21 AM »
....I believe to not use the character object

Ah very wise words.
Although 3D Rad provides a lot of useful objects which make game making easy for the beginner, these objects lock a serious developer in, and limit expanded possibilities. Don't get me wrong, these objects are great, and do what they must.
The best way to fly higher in the creative game making arena is to script your own stuff that you can change and extend beyond the capabilities of the visual and logic objects.... They are after all only made from code - but the code is closed, and therefore imposes it's own limitations.
« Reply #7 on: December 20, 2011, 03:57:25 AM »
100% agreed Jestermom, having a more open engine allows for better projects. But honestly, creating your own game from the ground up requires you to have full controll over your objects/creations. But then again 3D Rad is still a baby maybe if we could get more support for it we could see the engine on the same level as Unity and others.

jestermon

« Reply #8 on: December 20, 2011, 06:02:01 AM »
Not likely to happen CronoBJS. Fernando has moved on, and the chances of him spending time on something that does not pay him, is not very likely.. unless it's a hobby he does not want to let die. Time will tell

3D Rad is what it is - a free (partially) game development system for noobs. Although you can do amazing things with it, it's still a noob toy. Now why would I say something like that about an engine I love? Simple facts. It's really a completed game that allows you to build other games.. 3D Rad's visual development environment is actually a fully functioning game/3D simulation written with 3impact.
 
As far as Unity goes - It's the holy grail as far as most folks today are concerned, even though it's help support is worse than Microsoft's. and their forum search is so useless, it borders on pathetic. Even with that, the engine is killing every other Indie game engine on the market. None of them has survived the onslaught, and most of them are going "free" or "open source", which in certain respects is a good thing. Even the mighty Shiva and little DXstuio have been swept away by the Unity tornado. Since the millions of dollars of venture capital injected into the engine, it has become more stable, more powerful, and even I must admit - pretty awesome.

With all that said. 3D Rad is still the fastest R&D prototyping engine, which not even Unity can match for simplicity and ease of use. It's by scripting one's own objects, that one can extend 3D Rad even beyond the existing objects and features, that makes it all that more powerful to the serious game developer.

In the spirit of keeping the 3D Rad design concept alive, I am looking at designing something similar to 3D Rad (based on a different c++ engine to 3impact), but this is just a concept I am am working on. Nothing definitive yet.
« Last Edit: December 20, 2011, 06:07:09 AM by jestermon »

psikoT

« Reply #9 on: December 20, 2011, 07:28:58 AM »
In the spirit of keeping the 3D Rad design concept alive, I am looking at designing something similar to 3D Rad (based on a different c++ engine to 3impact), but this is just a concept I am am working on. Nothing definitive yet.

that sounds epic!!! :D (as 'someone' would say...)

« Reply #10 on: December 20, 2011, 07:43:29 AM »
that sounds epic!!! :D (as 'someone' would say...)

 :D :D

In the spirit of keeping the 3D Rad design concept alive, I am looking at designing something similar to 3D Rad (based on a different c++ engine to 3impact), but this is just a concept I am am working on. Nothing definitive yet.

Very interesting - tell me you're thinking of including support for soft bodies and the like.

If it's something that is as simple to use as 3drad and could support soft bodies and liquids, then I'd buy it.

jestermon

« Reply #11 on: December 20, 2011, 08:13:20 AM »
Yes, it will have full physX and Bullet support - wheels (they are actually physX primitives), softbodies and cloth. plus full support for shader3, using "off the shelf" fx's. The aim is to support DX9 - DX11, but as I said, it's still early days.. (I'll be using irrlicht). Scripting will be with Rhino (Netscape's javascript, very similar to AngelScript).

We are getting a little off topic here.. but thanks for the feedback.
« Last Edit: December 20, 2011, 08:17:09 AM by jestermon »
« Reply #12 on: December 22, 2011, 10:19:03 PM »
Good luck with your project jestermon, i like your choice for the scripting language.
be sure to tell us if you ever get anything ready to test!

jestermon

« Reply #13 on: December 22, 2011, 10:28:32 PM »
Thanks noaaisaiah, Rhino has enough maths, class and other built in system level support, making it a great interpreter. There are also millions of tutorials and references on the 'net. It is the most widely used interpreter in the world, so why not leverage it's power.

L33TMaster

« Reply #14 on: September 20, 2013, 11:57:42 AM »
ah here it is
Pages: [1]