deepthought Posted December 4, 2010 how would i give my DECORATE weapon 6 different powerlevels, and it increases for every few seconds you hold down the altfire button. what i've got now is actor laser : railgun replaces railgun { Weapon.SlotNumber 6 +Weapon.dontbob Weapon.SlotPriority 2 Weapon.AmmoUse1 5 Weapon.AmmoUse2 3 Weapon.ammotype1 "cell" Weapon.ammotype2 "cell" states { Ready: LASR AB 1 A_WeaponReady loop Deselect: LASR A 1 A_Lower loop Select: LASR A 1 A_Raise loop Fire: LASR ABCD 3 LASR A 0 A_FireCustomMissile("dummy",0,true,0,0,0) LASR DDD 0 A_CustomRailgun(1500,-8,"none","blue",1,0,2) LASR A 10 goto Ready AltFire: AltHold: LASR a 0 a_CheckForReload(5, "charge5", false) LASR A 3 charge1: LASR a 0 a_CheckForReload(1, "charge2", true) LASR G 5 LASR G 0 a_refire charge2: LASR a 0 a_CheckForReload(2, "charge3", true) LASR H 5 LASR G 0 a_refire charge3: LASR a 0 a_CheckForReload(3, "charge3", true) LASR I 5 LASR G 0 a_refire charge4: LASR a 0 a_CheckForReload(4, "charge5", true) LASR J 5 LASR G 0 a_refire charge5: LASR K 3 LASR K 0 a_refire } } 0 Share this post Link to post
AkiraZXE Posted December 8, 2010 I'm not an expert at DECORATE, and I've never seen A_CheckForReload used, but I do know a way to create the effect you are looking for (courtesy of Stronghold's railgun.) First of all, it would be much simpler to use a single inventory "charge item", and much cleaner. It would also let you use A_JumpIfInventory, which arguably is more useful. First, you would start of with a sequence of A_JumpIfInventory states, starting at the highest number of firing modes and working your way down. You need 1 less than the number of fire modes you are looking for. After you have that, use A_GiveInventory to give the player the charge item. The next state would be a state with A_Refire. Anything between those 2 would be the "charging up" sequence. The rest of the state would be the "uncharged" firing sequence (basically, just hitting fire). The final state before returning to Ready would take all the charge items from the player. You can fill in states however you want at this point, just as long as those code pointers don't end up ahead or behind where they are supposed to be. The rest of the fire modes are everything from A_GiveInventory on copy/pasted, the exception being whatever attack you want that charge to use, and the final charge should not give you a charge item. Also, you can make the final charge fire automatically by removing A_Refire from it. To help out, here is a rubric/example:AltFire: WEAP A 0 //I believe there is a problem involving the first state and jumping, but I'm not sure. Just in case. WEAP A 0 A_JumpIfInventory("ChargeItem",5,"Charge5") WEAP A 0 A_JumpIfInventory("ChargeItem",4,"Charge4") WEAP A 0 A_JumpIfInventory("ChargeItem",3,"Charge3") WEAP A 0 A_JumpIfInventory("ChargeItem",2,"Charge2") WEAP A 0 A_JumpIfInventory("ChargeItem",1,"Charge1") WEAP A 0 A_GiveInventory("ChargeItem",1) //Put a charging up sequence here, if you so desire. WEAP A 0 A_Refire //First firing sequence goes here. WEAP A 0 A_TakeInventory("ChargeItem",5) Goto Ready Charge1: WEAP A 0 A_GiveInventory("ChargeItem",1) //Charge sequence. WEAP A 0 A_Refire //Firing sequence. WEAP A 0 A_TakeInventory("ChargeItem",5) Goto Ready Charge2: WEAP A 0 A_GiveInventory("ChargeItem",1) //Charge sequence. WEAP A 0 A_Refire //Firing sequence. WEAP A 0 A_TakeInventory("ChargeItem",5) Goto Ready Charge3: WEAP A 0 A_GiveInventory("ChargeItem",1) //Charge sequence. WEAP A 0 A_Refire //Firing sequence. WEAP A 0 A_TakeInventory("ChargeItem",5) Goto Ready Charge4: WEAP A 0 A_GiveInventory("ChargeItem",1) //Charge sequence. WEAP A 0 A_Refire //Firing sequence. WEAP A 0 A_TakeInventory("ChargeItem",5) Goto Ready Charge5: //Remember, don't give a "charge item" here. //Charge sequence. WEAP A 0 A_Refire //Removing this makes the final charge fire automatically. //Firing sequence. WEAP A 0 A_TakeInventory("ChargeItem",5) Goto Ready All you need after that is to define your "charge item". That doesn't require an explanation, though. A simple look through the ZDoom Wiki would suffice. Hope this helped. 0 Share this post Link to post
deepthought Posted December 23, 2010 YYYYYYEEEEEEEESSSSSSSS! that makes sense. (edit) never mind. for some odd reason it jumps to the highest state even though there shouldn't be any charge items in my inventory. can you get the source of this stronghold railgun? 0 Share this post Link to post