[gameobject]rocket gravity.

Status
Not open for further replies.
Socius Decennalis
Decennium
Joined
Jan 29, 2011
Messages
174
Reaction score
53
Hello,
Can someone explain how to remove gravity of a gameobject in sources?
I try to make a rocket launcher and i don't know how to remove the gravity.:


EDIT :
What i done so far (sorry for loading screen):

I need to found a better way to do AOE Damage if someone can tell me how to.
 
Last edited:
  • Like
Reactions: DNC
You'll find what your looking for in Ammo.cpp and Ammo.h most likely as it would be the appropriate place to write gravity properties into the Ammo itself.
You'll find this in the WarZ solution
EclipseStudio - Game - GameObjects Code - Items/Weapons - Ammo.cpp & Ammo.h for other weapon types look in Bullet.cpp & Bullet.h
 
Upvote 0
Bruno, stop asking in multiple places.
No I'm not compiling the RSUpdate, as my environment is no where near like what is on the site at the moment.
It would waste my time and do you no good bud.

You can bump your help request in 24 hours as per the forum rules. Until then please allow some time for those that may be able to come help, come to your aid.
 
Upvote 0
You'll find what your looking for in Ammo.cpp and Ammo.h most likely as it would be the appropriate place to write gravity properties into the Ammo itself.
You'll find this in the WarZ solution
EclipseStudio - Game - GameObjects Code - Items/Weapons - Ammo.cpp & Ammo.h for other weapon types look in Bullet.cpp & Bullet.h

Thanks.
I'm making a new class for the rocket.
 
Upvote 0
It should also be written inside Ammo.cpp
As this is part of what the Ammo does on impact.
Hope the gravity issue is resolved now.

Take a look at Grenade.cpp and how they had coded up to this point.
Grenade don't do damage ingame.

Oh and for gravity instead of editing code i just make the rocket faster (No gravity rocket is not realistic after all).
 
  • Like
Reactions: DNC
Upvote 0
Grenade don't do damage ingame.

Oh and for gravity instead of editing code i just make the rocket faster (No gravity rocket is not realistic after all).
Like DNC says, Grenade.cpp...
But u need see to on ItemDB on Damage of Granade, for my local game works only on zombie, if i dont mistake, says:
Damage=0.001
I dont remeber now but i can put here, i know u need change Grenade.cpp, ItemDB and more 1 file, but head not remember as soon as you get home post code and related files.
 
Upvote 0
rocket onomnomnom :)

Folkz dont forget to post where must be modify the core for grenade dmg...

I think local player checkin is bad in cpp, but i do not trust in my brain yet:D

And thx :)
 
Upvote 0
What i done so far (sorry for loading screen):


I think i'm just going to give up about rocket launcher.
WOW!!!!!!
I need RPG *-*

You can use the same code of your RPG Explosion and Damage to Grenade....

My Files Conf.

ItensDB
<Weapon itemID="101310" category="27" upgrade="1" FNAME="EXP_M26" Weight="180">
<Model file="Data/ObjectsDepot/Weapons/EXP_M26.sco" AnimPrefix="EXP_M26" muzzlerOffset.x="0" muzzlerOffset.y="0" muzzlerOffset.z="0" />
<MuzzleModel file="" />
<HudIcon file="$Data/Weapons/HudIcons/EXP_M26.dds" />
<Store name="Frag Grenade" icon="$Data/Weapons/StoreIcons/EXP_M26.dds" desc="The fragmentation grenade is used to spray shrapnel upon exploding. Pull the pin and dont forget to throw it far.. Fire in the hole!" LevelRequired="0" />
<PrimaryFire bullet="grenade" damage="70" immediate="false" mass="10" decay="50" speed="20" area="20" delay="4" timeout="0" numShells="1" clipSize="1" reloadTime="1" activeReloadTick="0" rateOfFire="60" spread="1" recoil="1" numgrenades="0" grenadename="asr_grenade" firemode="100" ScopeType="default" ScopeZoom="0" />
<Animation type="grenade" />
<Sound shoot="" reload="" />
<FPS IsFPS="1" i0="0" i1="0" i2="0" i3="0" i4="0" i5="0" i6="0" i7="0" i8="0" d0="0" d1="0" d2="0" d3="0" d4="0" d5="0" d6="0" d7="0" d8="0" />
</Weapon>

Grenade.cpp

// do damage only if owner is local player, otherwise we will broadcast damage multiple times
r3d_assert(owner);
if(owner->NetworkLocal)
{
obj_Player* plr = (obj_Player*)owner;
for(int i=1; i<NUM_WEAPONS_ON_PLAYER; ++i)
{
if(plr->m_Weapons && plr->m_Weapons->getItemID() == m_Weapon->m_itemID)
{
gClientLogic().ApplyExplosionDamage(GetPosition(), m_Weapon->m_AmmoArea, i);
break;
}
}
}


setActiveFlag(0);


clear that the damage in itemDB you choose :)
 
Upvote 0
So your code really work ? (i mean aoe damage).
If it work it should be better for me because i have some problem with it and this rocket launcher is annoying me sometime.
 
Upvote 0
So your code really work ? (i mean aoe damage).
If it work it should be better for me because i have some problem with it and this rocket launcher is annoying me sometime.
On Local GameServer u can kill zombies whit this code, but when someone join on game and use grenade the another players crashes, is something aroun ItemDB, i tink is to much damage.....
 
Upvote 0
Status
Not open for further replies.
Back