Author |
Message |
Urch
Joined: Mon Sep 28, 2009 2:15 am Posts: 720 Location: A fucking desert.
|
Weapon sprites
how would i make a weapon display a certain frame while reloading, and a different frame while loaded?
|
Sun Nov 15, 2009 3:47 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Weapon sprites
if you mean displaying a magazine as though its in the weapon, see the multitude of examples out there. if you mean, like, adding a light or something once its loaded you're going to need to sprite the magazine to look like those things and set it to discardable = 0, like the shotgun magazine and a few others. there is no real build in way, i dont think.
|
Sun Nov 15, 2009 4:24 am |
|
|
Urch
Joined: Mon Sep 28, 2009 2:15 am Posts: 720 Location: A fucking desert.
|
Re: Weapon sprites
i actually meant like, making a crossbow appear loaded when it's loaded and not loaded when it's not loaded. if i could do that with magazines i'd like to know how, because i do not want a shot firing and an identicle image spawning due to the magazine coming out as well.
|
Sun Nov 15, 2009 4:47 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Weapon sprites
thats why you make the magazine undiscardable. look at the bear federation RPG for a practical example.
|
Sun Nov 15, 2009 6:42 am |
|
|
Urch
Joined: Mon Sep 28, 2009 2:15 am Posts: 720 Location: A fucking desert.
|
Re: Weapon sprites
thank-you for helping me with this.
|
Sun Nov 15, 2009 9:49 am |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Weapon sprites
Or you can always make the magazine null and just make the sprites frames whatever... Am I the only one who does this?
|
Sun Nov 15, 2009 11:06 am |
|
|
Urch
Joined: Mon Sep 28, 2009 2:15 am Posts: 720 Location: A fucking desert.
|
Re: Weapon sprites
CrazyMLC wrote: Or you can always make the magazine null and just make the sprites frames whatever... Am I the only one who does this? this is what i was asking how to do.
|
Sun Nov 15, 2009 6:37 pm |
|
|
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
|
Re: Weapon sprites
Weapons automatically do it, frame 1(000) shows when not fired and frame 2(001) shows when fired. You just have to make two frames and make CC use 'em like always.
|
Sun Nov 15, 2009 7:14 pm |
|
|
Urch
Joined: Mon Sep 28, 2009 2:15 am Posts: 720 Location: A fucking desert.
|
Re: Weapon sprites
oh. then no, that's not what i wanted.
|
Sun Nov 15, 2009 8:53 pm |
|
|
Metal Meltdown
Banned
Joined: Thu May 14, 2009 9:22 pm Posts: 826 Location: Lookin' forward to mocking people on Jan 1st 2013.
|
Re: Weapon sprites
MLC's point was that if it's a one-shot weapon, you can simply have the first frame loaded, and the second will kick in once the round is fired, i.e. when the weapon reloads, if it's timed right.
|
Sun Nov 15, 2009 9:23 pm |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Weapon sprites
If'n you want something like a crossbow bolt to disappear when reloading, take a look at the crossbow and bows in Melee Master Arms. They do what you want.
|
Mon Nov 16, 2009 12:12 am |
|
|
Urch
Joined: Mon Sep 28, 2009 2:15 am Posts: 720 Location: A fucking desert.
|
Re: Weapon sprites
If i make two sprites for something, and leave it as default, the sprite changes while firing then changes back instantly after firing, but does not stay on the second frame when reloading. Edit: what i wanted to make, is have the top sprite be the sprite when loaded, but after firing, to have the bottom sprite be the sprite, then when done reloading, the top sprite is the sprite again.
|
Mon Nov 16, 2009 12:29 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Weapon sprites
Lua could do that, but not .ini coding (at least I don't think so).
To do that with Lua, give the gun an emitter that has BurstSize = 1 and ParticlesperMinute = 0. The particle it fires is Lua'd and finds the closest MO ( your gun). Then it detects it the gun has max ammo or not and changes the frame accordingly. The gun should also be Lua'd to look for the Lua particle on the Create function and make it if it doesn't exist so it can work in the bunker building phase.
My pulse rifles use this trick, except of changing frames, it switches weapons.
|
Mon Nov 16, 2009 1:56 am |
|
|
Urch
Joined: Mon Sep 28, 2009 2:15 am Posts: 720 Location: A fucking desert.
|
Re: Weapon sprites
I am sad now. i don't know lua. oh well, i guess i can always make it at some other time when i've actually learned lua.
|
Mon Nov 16, 2009 2:15 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Weapon sprites
Duh102 wrote: If'n you want something like a crossbow bolt to disappear when reloading, take a look at the crossbow and bows in Melee Master Arms. They do what you want. Go try this, rather than any lua hackiness.
|
Mon Nov 16, 2009 4:30 am |
|
|
|