View previous topic :: View next topic |
Author |
Message |
ShadowHunter Guest
|
Posted: Thu Jul 19, 2007 11:10 am Post subject: Really unlimited Ammo |
|
|
Seems my question about scanner functions will never be answered.
So I've got another question...
Somebody know how to make weapons that doesnt uses ammo?It's not fast recharging ammo (kinda upgraded DefaultAmmo).Place where usually drawed icon with AmmoIcon and AmmoAmount are empty. |
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Fri Jul 20, 2007 11:17 am Post subject: |
|
|
Uhm, i for example the Flakcannon. You can just remove the useammo(1) function at both fire functions. _________________
|
|
Back to top |
|
|
ShadowHunter Guest
|
Posted: Sat Jul 21, 2007 7:58 am Post subject: |
|
|
Hmm...Really - I tried.After that weapon made one shot and after that you can only throw it away.But i'l try again maybe I did someth wrong.
But anyway thanks for advice. |
|
Back to top |
|
|
TheGuyWhoGotOn
Joined: 21 Nov 2006 Posts: 40
|
Posted: Thu Aug 30, 2007 10:19 pm Post subject: |
|
|
ShadowHunter wrote: | Hmm...Really - I tried.After that weapon made one shot and after that you can only throw it away.But i'l try again maybe I did someth wrong.
But anyway thanks for advice. |
I did it to almost all the guns once...I just don't remember how, sorry. |
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
Posted: Wed Sep 05, 2007 6:13 pm Post subject: |
|
|
infinite ammo...
DONT'S: useammo(0), example: stinger will only shoot 1 proj in altfire with this;
DO's: open Weapon class script, search fire function fire and altfire, copy all, thenh delete
if( UseAmmo(1) )
{
//dont delete the middle if you were thinking that...
}
easy way:
example: make a class like'InfinWep' or something like that, then past the new functions fire and altfire in it, then make the new weps a subclass of this one. if it will be stinger-like, just copy stinger script(or other weapon), then look in that script for fire and altfire. if it is there, delete the if(useammo) part.
that should do it |
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Wed Sep 05, 2007 8:18 pm Post subject: |
|
|
Bleeder91 wrote: | infinite ammo...
DONT'S: useammo(0), example: stinger will only shoot 1 proj in altfire with this;
DO's: open Weapon class script, search fire function fire and altfire, copy all, thenh delete
if( UseAmmo(1) )
{
//dont delete the middle if you were thinking that...
}
easy way:
example: make a class like'InfinWep' or something like that, then past the new functions fire and altfire in it, then make the new weps a subclass of this one. if it will be stinger-like, just copy stinger script(or other weapon), then look in that script for fire and altfire. if it is there, delete the if(useammo) part.
that should do it |
The first thing you said isnt rally correct, You need to define it good. You proberly just changed it to useammo 0 or so. I define it and it works.. _________________
|
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
Posted: Thu Sep 20, 2007 5:50 pm Post subject: |
|
|
useammo(0), try that for stinger's altfire inside the for(): it'll only shoot 1 proj then |
|
Back to top |
|
|
.:..:
Joined: 30 Nov 2004 Posts: 11 Location: Finland
|
Posted: Thu Sep 20, 2007 8:48 pm Post subject: |
|
|
Another very simple way is to create a new ammo class and put this code in:
Code: |
function bool UseAmmo(int AmountNeeded)
{
return True;
}
|
Then change every weapon's ammoname to that, which can easly be done with a mutator:
Code: |
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if( Weapon(Other)!=None && Weapon(Other).AmmoName!=None )
Weapon(Other).AmmoName = Class'MyAmmoClass';
return true;
}
|
|
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
Posted: Sat Sep 22, 2007 5:29 pm Post subject: |
|
|
hmmpf.. dots gotta own us all, only my way is simpler dots's way needs mutator XD |
|
Back to top |
|
|
ShadowHunter Guest
|
Posted: Tue Sep 25, 2007 4:09 pm Post subject: |
|
|
Once i asked Ageukkely.He said same thing like Bleeder91 recommended to me:make new subclass of class weapons,copy there code from main class and delete all about ammo.Than make there new weapons and delete function if(UseAmmo(1)).But after that i've got another problem:
Weapons wont switch with numbers,only by wheel.If i hit some number with weapon it said that this weapon Have no ammo.
I didn't tried Bleeder91's way....Hope it will work correctly...
Ty Bleeder. |
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
Posted: Wed Sep 26, 2007 6:09 pm Post subject: |
|
|
np, if there still are any problems then mail me: .bleeder91.@hotmail.com
(without the two dots) |
|
Back to top |
|
|
ShadowHunter Guest
|
Posted: Sat Sep 29, 2007 8:37 am Post subject: |
|
|
Well,thankyou Bleeder.That thing worked.I found what mistake did i made:I deleted EVERYTHING that concemed ammo. |
|
Back to top |
|
|
Killer_Skaarj
Joined: 01 Aug 2007 Posts: 8
|
Posted: Thu Jan 31, 2008 12:53 am Post subject: |
|
|
Alright, now that you guys solved his problem, can you solve mine? It's kinda similar, as it has to to with unlimited ammo.
How do I make the Stinger have unlimited ammo for primary fire but limited ammo for alt fire? In other words, the alt fire wastes ammo, but the primary fire doesn't.
Can anyone help me out?
EDIT: Dang, wrong account... _________________ I was K죣èr_§kā&#, until it got deactivated. |
|
Back to top |
|
|
ShadowHunter Guest
|
Posted: Sat Feb 02, 2008 11:26 am Post subject: |
|
|
Hmm...I'l think about this problem.
But...Try this...
Delete from primary fire string like :
if(AmmoType.UseAmmo(1)
and leave samee string in alt fire. |
|
Back to top |
|
|
Bleeder91
Joined: 28 Sep 2006 Posts: 265
|
Posted: Sat Feb 02, 2008 1:31 pm Post subject: |
|
|
stinger's altfire. many ppl have problems with that yeah, tho it is very easy to fix. just look very carefully, here:
Code: |
state AltFiring
{
function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
{
local Projectile S;
local int i;
local vector Start,X,Y,Z;
local Rotator StartRot, AltRotation;
S = Global.ProjectileFire(ProjClass, ProjSpeed, bWarn);
StartRot = S.Rotation;
Start = S.Location;
for (i = 0; i< 4; i++)
{
if (AmmoType.UseAmmo(1))
{
AltRotation = StartRot;
AltRotation.Pitch += FRand()*3000-1500;
AltRotation.Yaw += FRand()*3000-1500;
AltRotation.Roll += FRand()*9000-4500;
S = Spawn(AltProjectileClass,,, Start - 2 * VRand(), AltRotation);
}
}
StingerProjectile(S).bLighting = True;
}
Begin:
FinishAnim();
PlayAnim('Still');
Sleep(1.0);
Finish();
} |
Now take a look at this piece:
Code: |
state AltFiring
{
function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn)
{
local Projectile S;
local int i;
local vector Start,X,Y,Z;
local Rotator StartRot, AltRotation;
S = Global.ProjectileFire(ProjClass, ProjSpeed, bWarn);
StartRot = S.Rotation;
Start = S.Location;
for (i = 0; i< 4; i++)
{
AltRotation = StartRot;
AltRotation.Pitch += FRand()*3000-1500;
AltRotation.Yaw += FRand()*3000-1500;
AltRotation.Roll += FRand()*9000-4500;
S = Spawn(AltProjectileClass,,, Start - 2 * VRand(), AltRotation);
}
StingerProjectile(S).bLighting = True;
}
Begin:
FinishAnim();
PlayAnim('Still');
Sleep(1.0);
Finish();
} |
almost the same as primary fire, just delete the useammo piece, that should do it! |
|
Back to top |
|
|
|