Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 12,885 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Paintball Game -- Paintball gravity #67664
03/22/06 09:22
03/22/06 09:22
Joined: Nov 2005
Posts: 66
Spokane, WA, USA
Vonman Offline OP
Junior Member
Vonman  Offline OP
Junior Member

Joined: Nov 2005
Posts: 66
Spokane, WA, USA
I am making a paintball shooter game but need to figure out how to make the paintballs fall with gravity instead of shooting straght as a laser beam.. I have no problem clearing and restarting the shooting aspect of my script (I am willing to do it right if I can).

The thing is, I actualy made it shoot paintballs, and infact made them follow gravity, but the problem is that every time I shoot, each new paintball shoots twice as fast and falls twice as fast as the ball before it, AND the other ball before it stops in mid air (make sense?)

Thx for reading my post, hope someone knows :-)

Re: Paintball Game -- Paintball gravity [Re: Vonman] #67665
03/22/06 10:43
03/22/06 10:43
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline
Serious User
indiGLOW  Offline
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
Well in it's simplest form I guess adding a negative z axis value after each frame of movement would simulate gravity, without using physics.

I say without physics, as I would expect you will have hundreds of paint balls in the air at any one time, and doing all of that with physics is not really an option as I understand it.
Much better to do this with entities with assigned action to drop the balls every frame.

Hope that helps


The Art of Conversation is dead : Discuss
Re: Paintball Game -- Paintball gravity [Re: indiGLOW] #67666
03/22/06 18:27
03/22/06 18:27
Joined: Nov 2005
Posts: 66
Spokane, WA, USA
Vonman Offline OP
Junior Member
Vonman  Offline OP
Junior Member

Joined: Nov 2005
Posts: 66
Spokane, WA, USA
I see where you're coming from on that but I tryed that, but the only thing that happens is that the ball shoots straght downward, even if I aim up.. The gravity value itself needs to "accelerate" so that if I shoot upward, it will gradualy change direction toward the ground.

The way I have it, the ball does exactly what I want it to do on the first shot, it falls right, but the problem is that the NEXT shot, the ball shoots twice as fast and falls twice as fast (as if both the shotspeed and gravity it doubled). So what I need to do is figure out how to make it consistant. In the stock tutorial, in the doors and keys section, it says something about using SKILL's instead of VAR's because there might be more than just ONE entity using the value (of bulletspeed or gravity), but I don't know how to work with SKILLS as opposed to VARs (but i'm trying).

Re: Paintball Game -- Paintball gravity [Re: Vonman] #67667
03/23/06 17:12
03/23/06 17:12
Joined: Oct 2003
Posts: 1,550
United Kingdom
indiGLOW Offline
Serious User
indiGLOW  Offline
Serious User

Joined: Oct 2003
Posts: 1,550
United Kingdom
well a skill is just a variable that is linked directly to that specific entity, there fore defining a skill, which is not completely neccassary but its much tidier:

Code:

DEFINE GRAV_ACCEL, skill10; //just an example



allows you to store a figure in the entities skill box, instead of a possibly global variable like temp.

Code:


action I_AM_SOMETHING()
{
while(1){
my.GRAV_ACCELL += time*random(10);
wait(1);
}
}
}



..simply adds random amount of time to the entities skill value. If two entities ran this same code, their GRAV_ACCELL skills would contain different values. In this way you could increase/decrease the amount of simulated gravity/air-friction over time, for each paintball.

Thats a little bit about skills.

However here is how I would think about implementing it:

Use a low value for the gravity, keep it constant. According to ballistics, the projectile will fall from the moment it leaves the barrel. The key is to reduce the force of the projectile over time. Lets call this air-friction

This means that while the air-friction is low the ball will travel much further per frame, whilst only dropping a tiny amount, but as the air-friction, grows the drop will become more down than along...

If you would like I can try to write you a basic script, or maybe someone else here will, to demonstrate.

Ultimatly there is no real difference about which you adjust, the rate of fall or the air-resistance, I just personally would do resistance, bcz messing with gravity would have Newton turning in his grave

Hope thats of some use


The Art of Conversation is dead : Discuss

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1