Help with my gun

Need some nice Mods? Here, you are right!
User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Help with my gun

Post by mmdanggg2 » Wed Mar 25, 2009 8:11 pm

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.

User avatar
Feralidragon
Godlike
Posts: 5138
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Help with my gun

Post by Feralidragon » Thu Mar 26, 2009 9:37 am

PM me the files to check what's wrong, and I will let you know.

User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Re: Help with my gun

Post by mmdanggg2 » Fri Mar 27, 2009 7:49 pm

the problem has been fixed

if i have more problems i will post them on here

User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Re: Help with my gun

Post by mmdanggg2 » Mon Apr 13, 2009 6:02 pm

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.

User avatar
Feralidragon
Godlike
Posts: 5138
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Help with my gun

Post by Feralidragon » Tue Apr 14, 2009 9:20 am

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:

User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Re: Help with my gun

Post by mmdanggg2 » Tue Apr 14, 2009 10:23 am

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

User avatar
Feralidragon
Godlike
Posts: 5138
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Help with my gun

Post by Feralidragon » Tue Apr 14, 2009 7:10 pm

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.

User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Re: Help with my gun

Post by mmdanggg2 » Tue Apr 14, 2009 8:52 pm

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

User avatar
Feralidragon
Godlike
Posts: 5138
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Help with my gun

Post by Feralidragon » Wed Apr 15, 2009 9:18 am

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.

User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Re: Help with my gun

Post by mmdanggg2 » Wed Apr 15, 2009 3:06 pm

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

User avatar
Feralidragon
Godlike
Posts: 5138
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Help with my gun

Post by Feralidragon » Wed Apr 15, 2009 3:25 pm

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;
}

User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Re: Help with my gun

Post by mmdanggg2 » Wed Apr 15, 2009 4:36 pm

I have copied your script into my mutator and it's not compiling with the error '||':bad command or expression

User avatar
Feralidragon
Godlike
Posts: 5138
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Help with my gun

Post by Feralidragon » Wed Apr 15, 2009 5:07 pm

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.

User avatar
mmdanggg2
Novice
Posts: 17
Joined: Thu Jul 24, 2008 6:03 pm

Re: Help with my gun

Post by mmdanggg2 » Wed Apr 15, 2009 5:19 pm

I've tried that and it's not working same error

User avatar
Feralidragon
Godlike
Posts: 5138
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: Help with my gun

Post by Feralidragon » Wed Apr 15, 2009 5:34 pm

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).

Post Reply