thesecondcomingdoom Posted March 19, 2016 ACTOR Jetpack : Powerup 10004 { Powerup.Duration 60 Inventory.Pickupmessage "JetPack!" +INVENTORY.HUBPOWER +INVENTORY.ALWAYSPICKUP States { Spawn: JETP A 1 bright Loop } } Ok, so here's my little jetpack code, when i try to take it (or summon it) it disappears inmediately, and doesn't give me anything. It seems to fall down the ground. 0 Quote Share this post Link to post
scifista42 Posted March 19, 2016 That's not how you make powerup pickups. Try this instead:ACTOR Jetpack : PowerupGiver 10004 { Powerup.Type "PowerFlight" Powerup.Duration 60 Inventory.Pickupmessage "JetPack!" +INVENTORY.HUBPOWER +INVENTORY.ALWAYSPICKUP States { Spawn: JETP A -1 bright stop } } The important part is inheriting from "PowerupGiver" instead of "Powerup". Also specifying "Powerup.Type" to an existing powerup type to make it actually give you some powerup when you pick it up. 0 Quote Share this post Link to post
wildweasel Posted March 19, 2016 Well, even though you've inherited from Powerup, that alone isn't enough to have any effect. You need to create another actor that inherits from PowerupGiver (this is the item in the world), then specify your jetpack as Powerup.Type. These two pages on the ZDoom Wiki should help: http://zdoom.org/wiki/Classes:PowerupGiver http://zdoom.org/wiki/Classes:Powerup 0 Quote Share this post Link to post
thesecondcomingdoom Posted March 19, 2016 ACTOR Jetpack : PowerupGiver 10004 { Powerup.Type "PowerFlight" Powerup.Duration 600 Inventory.Pickupmessage "JetPack!" inventory.maxamount 0 +INVENTORY.AUTOACTIVATE +INVENTORY.ALWAYSPICKUP States { Spawn: JETP A -1 bright stop } } This works pretty fine, but i can't fly for some reason, may anyone explain why? 0 Quote Share this post Link to post
scifista42 Posted March 19, 2016 My mistake, Powerup.Type should be set to "Flight", not "PowerFlight". EDIT: However, according to what I read on the PowerupGiver zdoom wiki page, "PowerFlight" should have worked too, so the real issue is probably elsewhere. 0 Quote Share this post Link to post
thesecondcomingdoom Posted March 19, 2016 scifista42 said:My mistake, Powerup.Type should be set to "Flight", not "PowerFlight". Oh, no problem, also How would i change the player sprite with this?, It's no problem if there's no way, i'd stay like that. 0 Quote Share this post Link to post
scifista42 Posted March 19, 2016 There are ways, but they're not so simple anymore. Either the pickup must morph the player into a different player class, or you must redefine the default player class and use A_JumpIfInventory trickery to display different sprites based on the presence of PowerFlight in the player's inventory. 0 Quote Share this post Link to post
thesecondcomingdoom Posted March 19, 2016 scifista42 said:There are ways, but they're not so simple anymore. Either the pickup must morph the player into a different player class, or you must redefine the default player class and use A_JumpIfInventory trickery to display different sprites based on the presence of PowerFlight in the player's inventory.ACTOR PowerFlightJet : Powerup { PowerMorph.PlayerClass "JetpackDoom" Powerup.Duration -60 +INVENTORY.HUBPOWER } ACTOR Jetpack : PowerupGiver 10004 { Powerup.Type "FlightJet" Powerup.Duration 600 Inventory.Pickupmessage "JetPack!" inventory.maxamount 0 +INVENTORY.AUTOACTIVATE +INVENTORY.ALWAYSPICKUP States { Spawn: JETP A -1 bright stop } } Would this do the job? Would i need to set something like a new "DoomPlayer" and make it "JetpackDoom" Would that work? 0 Quote Share this post Link to post
scifista42 Posted March 19, 2016 Your PowerFlightJet must inherit from PowerMorph to be able to morph. Similarly, if you wanted a custom powerup to make the player fly, it must inherit from PowerFlight. You keep declaring actors inheriting directly from the Powerup class, which is wrong. Other than that, OK, it should work, after you properly define the JetpackDoom player class, that is. You may even define the JetpackDoom player class to be able to fly by default, then you wouldn't need the PowerFlight powerup anymore, just the PowerMorph one. 0 Quote Share this post Link to post
thesecondcomingdoom Posted March 19, 2016 scifista42 said:Your PowerFlightJet must inherit from PowerMorph to be able to morph. Similarly, if you wanted a custom powerup to make the player fly, it must inherit from PowerFlight. You keep declaring actors inheriting directly from the Powerup class, which is wrong. Other than that, OK, it should work, after you properly define the JetpackDoom player class, that is. You may even define the JetpackDoom player class to be able to fly by default, then you wouldn't need the PowerFlight powerup anymore, just the PowerMorph one. ACTOR PowerFlight : Powerup { PowerMorph.PlayerClass "JetpackDoom" Powerup.Duration -60 +INVENTORY.HUBPOWER } ACTOR Jetpack : PowerupGiver 10004 { Powerup.Type "Flight" Powerup.Duration 600 Inventory.Pickupmessage "JetPack!" inventory.maxamount 0 +INVENTORY.AUTOACTIVATE +INVENTORY.ALWAYSPICKUP States { Spawn: JETP A -1 bright stop } } ACTOR JetpackDoom : PlayerPawn { Speed 1 Health 100 Radius 16 Height 56 Mass 100 PainChance 255 Player.DisplayName "Jetpack Morphed" Player.CrouchSprite "PLYC" Player.StartItem "Pistol" Player.StartItem "Fist" Player.StartItem "Clip", 50 Player.WeaponSlot 1, Fist, Chainsaw Player.WeaponSlot 2, Pistol Player.WeaponSlot 3, Shotgun, SuperShotgun Player.WeaponSlot 4, Chaingun Player.WeaponSlot 5, RocketLauncher Player.WeaponSlot 6, PlasmaRifle Player.WeaponSlot 7, BFG9000 Player.ColorRange 112, 127 Player.ColorSet 0, "Green", 0x70, 0x7F, 0x72 Player.ColorSet 1, "Gray", 0x60, 0x6F, 0x62 // Called "Indigo" originally so as to have a unique initial Player.ColorSet 2, "Brown", 0x40, 0x4F, 0x42 Player.ColorSet 3, "Red", 0x20, 0x2F, 0x22 // Doom Legacy additions Player.ColorSet 4, "Light Gray", 0x58, 0x67, 0x5A Player.ColorSet 5, "Light Brown", 0x38, 0x47, 0x3A Player.ColorSet 6, "Light Red", 0xB0, 0xBF, 0xB2 Player.ColorSet 7, "Light Blue", 0xC0, 0xCF, 0xC2 States { Spawn: PLAY A -1 Loop See: PLAY ABCD 4 Loop Missile: PLAY E 12 Goto Spawn Melee: PLAY F 6 BRIGHT Goto Missile Pain: PLAY G 4 PLAY G 4 A_Pain Goto Spawn Death: PLAY H 0 A_PlayerSkinCheck("AltSkinDeath") Death1: PLAY H 10 PLAY I 10 A_PlayerScream PLAY J 10 A_NoBlocking PLAY KLM 10 PLAY N -1 Stop XDeath: PLAY O 0 A_PlayerSkinCheck("AltSkinXDeath") XDeath1: PLAY O 5 PLAY P 5 A_XScream PLAY Q 5 A_NoBlocking PLAY RSTUV 5 PLAY W -1 Stop AltSkinDeath: PLAY H 6 PLAY I 6 A_PlayerScream PLAY JK 6 PLAY L 6 A_NoBlocking PLAY MNO 6 PLAY P -1 Stop AltSkinXDeath: PLAY Q 5 A_PlayerScream PLAY R 0 A_NoBlocking PLAY R 5 A_SkullPop PLAY STUVWX 5 PLAY Y -1 Stop } } Sorry if this code is really long. I get this in GZdoom Execution could not continue. Script error, "cooldoomremastered.wad:DECORATE" line 1069: Unexpected 'JetpackDoom' in definition of 'PowerFlight' 0 Quote Share this post Link to post
scifista42 Posted March 19, 2016 thesecondcomingdoom said:ACTOR PowerFlight : Powerup { PowerMorph.PlayerClass "JetpackDoom" Powerup.Duration -60 +INVENTORY.HUBPOWER } No, no, no. You shouldn't just overwrite an existing actor (PowerFlight) by your own definition of it, let alone one with native special behavior. This is how I meant you should do it:ACTOR PowerJet : PowerMorph { PowerMorph.PlayerClass "JetpackDoom" Powerup.Duration -60 +INVENTORY.HUBPOWER } ACTOR Jetpack : PowerupGiver 10004 { Powerup.Type "PowerJet" // or "Jet", whatever works ... PowerJet must have a unique name (like every newly defined actor) and must inherit from PowerMorph (to gain the ability to morph the player). 0 Quote Share this post Link to post
thesecondcomingdoom Posted March 19, 2016 scifista42 said:-snip- Whoa, That sure did the job!, Now how would i make the JetpackDoom fly? Would we use a + flag, I'll go ahead and try that. Thanks for the help. 0 Quote Share this post Link to post
scifista42 Posted March 19, 2016 http://forum.zdoom.org/viewtopic.php?f=3&t=32008call SetPlayerProperty on its spawn state But NOT on the very first spawn state, because the very first spawn state doesn't execute its action when it's called for the first time. 0 Quote Share this post Link to post
thesecondcomingdoom Posted March 19, 2016 scifista42 said:http://forum.zdoom.org/viewtopic.php?f=3&t=32008 But NOT on the very first spawn state, because the very first spawn state doesn't execute its action when it's called for the first time. Thanks, that was enough, Thank you scifista, it took a while, but turns out the gzdoom engine can do everything! 0 Quote Share this post Link to post
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.