Page 1 of 2

Help with my gun

Posted: Wed Mar 25, 2009 8:11 pm
by mmdanggg2
My gun is going well but i need help with the HUD display icon when its selected.

I have created my icon and put it in a utx and saved.

I set the default properties icon and status icon to the my icon and saved.

But when i play it and select the gun the icon is just blank.

Re: Help with my gun

Posted: Thu Mar 26, 2009 9:37 am
by Feralidragon
PM me the files to check what's wrong, and I will let you know.

Re: Help with my gun

Posted: Fri Mar 27, 2009 7:49 pm
by mmdanggg2
the problem has been fixed

if i have more problems i will post them on here

Re: Help with my gun

Posted: Mon Apr 13, 2009 6:02 pm
by mmdanggg2
ok I've got the gun working and i have made a second gun using the same ammo and bullets.
I've got a gun replacement so it swaps the shock rifle with my god rifle and sniper rifle with my god sniper.
I don't know how to swap the bullet box with the god core and the shock core with the god core.

Re: Help with my gun

Posted: Tue Apr 14, 2009 9:20 am
by Feralidragon
mmdanggg2 wrote:ok I've got the gun working and i have made a second gun using the same ammo and bullets.
I've got a gun replacement so it swaps the shock rifle with my god rifle and sniper rifle with my god sniper.
I don't know how to swap the bullet box with the god core and the shock core with the god core.
So you mean, you want both weapons using your "godcore" instead of the shockcore and bulletbox, is that it?
Well, first off I suppose you already created your ammo class named "godcore".
Then, if you look closelly in the Weapon properties section, you will see AmmoName.
Just set that default property (AmmoName) to the "godcore" class, and done. :thuup:

Re: Help with my gun

Posted: Tue Apr 14, 2009 10:23 am
by mmdanggg2
You've misunderstood I have done that but I want to swap the ammo in the map with a mutator like I said I've done that with the weapons using a mutator but I can't do it with ammo

Re: Help with my gun

Posted: Tue Apr 14, 2009 7:10 pm
by Feralidragon
mmdanggg2 wrote:You've misunderstood I have done that but I want to swap the ammo in the map with a mutator like I said I've done that with the weapons using a mutator but I can't do it with ammo
Oh, replace both with the mutator. Basically is the exact same way with weapons: you use those replace functions instead to replace ammo.

Re: Help with my gun

Posted: Tue Apr 14, 2009 8:52 pm
by mmdanggg2
I'm not sure what you mean I copied the replacing script from a pckage called samauri I tried to change it to work with ammo but it's not working so :noidea

Re: Help with my gun

Posted: Wed Apr 15, 2009 9:18 am
by Feralidragon
mmdanggg2 wrote:I'm not sure what you mean I copied the replacing script from a pckage called samauri I tried to change it to work with ammo but it's not working so :noidea
Post here the replacing code, and tell me what class does your ammo expands from.

Re: Help with my gun

Posted: Wed Apr 15, 2009 3:06 pm
by mmdanggg2
here is the code for replacing the shock rifle with the god rifle:

//=============================================================================
// GodRifleMutator.
//=============================================================================
class GodrifleMutator expands Mutator;

function bool alwaysKeep(Actor o)
{
if (o.IsA('GodRifle') || o.IsA('ShockCore'))
{
return true;
}
if (NextMutator != None)
{
return (NextMutator.AlwaysKeep(o));
}
return false;
}

function bool checkReplacement(Actor o, out byte bSuperRelevant)
{
if (o.isA('ShockRifle') && !o.isA('GodRifle'))
{
replaceWith(o, "MyPackage.GodRifle");
return false;
}

bSuperRelevant = 0;
return true;
}




and the god core extends from the shock core

Re: Help with my gun

Posted: Wed Apr 15, 2009 3:25 pm
by Feralidragon
Then it will be like this (as you will see, is as easy as the weapon replacement):

function bool checkReplacement(Actor o, out byte bSuperRelevant)
{
if (o.isA('ShockRifle') && !o.isA('GodRifle'))
{
replaceWith(o, "MyPackage.GodRifle");
return false;
}

//This replaces both Shock Core and Bullet Box for a God Core
if ((o.isA('ShockCore') && !o.isA('GodCore')) || o.isA('BulletBox'))
{
replaceWith(o, "MyPackage.GodCore");
return false;
}


bSuperRelevant = 0;
return true;
}

Re: Help with my gun

Posted: Wed Apr 15, 2009 4:36 pm
by mmdanggg2
I have copied your script into my mutator and it's not compiling with the error '||':bad command or expression

Re: Help with my gun

Posted: Wed Apr 15, 2009 5:07 pm
by Feralidragon
mmdanggg2 wrote:I have copied your script into my mutator and it's not compiling with the error '||':bad command or expression
WTF? || stands for logical condition "or", like && stands for "and"... it should compile.

Try to copy like it is to a notepad first, and then copy from the notepad to the code itself, and see what happens, because that shoudn't happen.

Re: Help with my gun

Posted: Wed Apr 15, 2009 5:19 pm
by mmdanggg2
I've tried that and it's not working same error

Re: Help with my gun

Posted: Wed Apr 15, 2009 5:34 pm
by Feralidragon
mmdanggg2 wrote:I've tried that and it's not working same error
hmm, PM me your files, to see if I can make those compile and see what's wrong (either by me or you).