[DECORATE] Weapon.PreferredSkin with same weapon but different classes?
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[DECORATE] Weapon.PreferredSkin with same weapon but different classes?
It's a quite simple question, is it possible to use Weapon.PreferredSkin with the same weapon but on different player classes?
Like, two characters have an entirely different appearence but they are both able to pickup the same type of weapon.
Like, two characters have an entirely different appearence but they are both able to pickup the same type of weapon.
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
I think you're gonna need two copies of each weapon.
No biggie, just use inheritance.
No biggie, just use inheritance.
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
Uh, that's gon be a bit complicated when it comes to picking up a weapon an enemy player dropped while playing a different classes....Ænima wrote:I think you're gonna need two copies of each weapon.
No biggie, just use inheritance.
^^Because that is mainly my problem. Otherwise i'd just do variant for each characters.
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
CustomInventory with jumps in the pickup state based on "checker" items given to different classes. Make the weapon itself spawn this item in its Spawn state before instantly disappearing. This item should look like the weapon and have the same pickup message, except when it gets picked up it will give a different version of the weapon based on what class "token" item you have. It's a bit of a workaround but it's really the only way to do what you want unless you wanna put tons of jumps in every state of your playerclass to go to different frames for different weapons (like I did in Super Skulltag), but that will require "checker" items for every single weapon, and is generally very messy.FranckyFox2468 wrote:Uh, that's gon be a bit complicated when it comes to picking up a weapon an enemy player dropped while playing a different classes....Ænima wrote:I think you're gonna need two copies of each weapon.
No biggie, just use inheritance.
^^Because that is mainly my problem. Otherwise i'd just do variant for each characters.
I'd write an example code but I'm on my phone right now.
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
Think i already tried the item drop during the "spawn" state and it didn't work quite well. But i might have been doing it wrong. Gon' wait and see what is your code about. Thanks a lot in advance :D
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
Uh, you weren't you going to write a code or something? If not its fine but i was just curious to see what you came up with.
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
I'm sorry. I've just been very busy lately outside of Doom.FranckyFox2468 wrote:Uh, you weren't you going to write a code or something? If not its fine but i was just curious to see what you came up with.
Anyways, here's what my code would look like:
Code: Select all
actor ak47giver : custominventory
{
Inventory.PickupMessage "You got the AK47!"
Inventory.PickupSound "pickup/AK"
states
{
Spawn:
AKGN A -1
Stop
Pickup:
TNT1 A 0
TNT1 A 0 A_JumpIfInventory("CopAK47",1,"AmmoCheck")
TNT1 A 0 A_JumpIfInventory("RobberAK47",1,"AmmoCheck") //just gives ammo if you already have the gun
Goto ClassCheck
ClassCheck:
TNT1 A 1 A_JumpIfInventory("IsCop",1,"GetCopAK")
TNT1 A 1 A_JumpIfInventory("IsRobber",1,"GetRobberAK") //check for the "token" items that classes start with to identify themselves
Goto PickupFail
GetCopAK:
TNT1 A 0 A_GiveInventory("CopAK47",1)
stop
GetRobberAK:
TNT1 A 0 A_GiveInventory("RobberAK47",1)
stop
AmmoCheck: // like a "real" weapon pickup, you won't pick it up if you already have it and your ammo is full
TNT1 A 0 A_JumpIfInventory("BackPack",1,"AmmoCheckBackpack")
TNT1 A 0 A_JumpIfInventory("7.62Round",100,"PickupFail")
Goto AmmoPickupSucceed
AmmoCheckBackpack: // otherwise, backpacked players would still be limited to the non-backpack amount
TNT1 A 0 A_JumpIfInventory("7.62Round",200,"PickupFail")
Goto AmmoPickupSucceed
AmmoPickupSucceed:
TNT1 A 0 A_GiveInventory("7.62Round",16)
Stop
PickupFail:
TNT1 A 1 BRIGHT
fail
}
}
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
Aww man, thanks a lot! Ima be sure to give you a special thanks in the credits of any mod i use this :D
By the way, one last question. How do i handle the weapon itself's spawn state. Do i just use a a_spawnitem or a_spawnitemex or is there something else specific i should know?
By the way, one last question. How do i handle the weapon itself's spawn state. Do i just use a a_spawnitem or a_spawnitemex or is there something else specific i should know?
- FranckyFox2468
- Forum Regular
- Posts: 180
- Joined: Sat May 07, 2016 8:30 pm
[DECORATE] Re: Weapon.PreferredSkin with same weapon but different classes?
sorry to necro but i actually got around this part of the weapon and im not sure how to make the weapon "spawn" state spawn the weapon giver properly.
I tried to make something using "spawnitem ex" but it drops at the player's spawn location rather than the player' current location.
I tried to make something using "spawnitem ex" but it drops at the player's spawn location rather than the player' current location.