†TYRANICK†™ Posted January 5, 2009 Share Posted January 5, 2009 Ok so scrapping my other thread, here's an updated one. This one is dealing with the main juice of the scripts I'll need to create for my PA's mod. The help I have gotten so far is slowly pointing me in the right direction, but actually applying these to script format is somewhat more difficult. The basic script Reinhart Menken put together for me is as follows, "this should allow the shield to take damage for the player and restore that damage back to the player": float shieldvalue float hp float lasthp float timer float restoretimer short doonce Begin GameMode if player.isincombat if doonce == 0 set lasthp to player.getav health set doonce to 1 endif if shieldvalue > 0;so it only works when there's shield if timer > 0 set timer to timer - GetSecondsPassed else set hp to player.getav health if hp < lasthp set shieldvalue to shieldvalue - (lasthp - hp) player.restoreav health (lasthp - hp) endif set timer to 1 endif endif else set doonce to 0 endif end So yeah, the problem arises is that I have no idea where to put in my values as described below... Over all i do want to try and make it so I get damage to apply to AP first BEFORE applying damage to the player, menken was going on about something which does damage to the player first, then restores it, then takes off the AP. I had a think about this and this could work. To start with, my shield effect will be this: Set DR to 70Set ERS(Energy Resistance) to 70Set FRS(Fire Resistance) to 70Set EMPR(EMP Resistance) to Yes/1/on whateverSet PRS(Poisen Resistance) to Yes/1/on whatever So it would work overall like this: "Player has full AP's. Apply shield effect. Player takes damage. Deal half of that damage and turn it into amount or % of AP taken off (For example, 30 damage would be done to you, your Resistances are at 70 so you only take 9 damage, tranfer that 9 damage to 9 AP's and remove 9AP from players total AP). When AP reach 0, disable shield effect (DR/ERS/FRS/EMPRS/PRS all turned off or set back to original amounts), player continues to take damage as normal. Add a timer that waits X seconds for AP's to regenerate AS LONG AS the player is out of combat, then re-apply shield as soon as AP regeneration kicks in, and repeat) Oh and: "If player has taken damage but shield is still active (say still has AP left after combat) wait till player is out of comabt for normal regen amount (OR) to avoid bugs, just apply normal regen as above & regardless of in/out of combat, maybe at a much slower rate" So yeah...that's what I'd like to do, I know the above is probably a lot to take in, that I apologise for but in all honestly I wouldn't know where to start, I know about having to set new gamemodes and all that, and once put on the right tracks could just peace it together NP. Any help anyone could give would be greatly appreciated :) Link to comment Share on other sites More sharing options...
†TYRANICK†™ Posted January 6, 2009 Author Share Posted January 6, 2009 Bump. Ok this is what I have so far: scn EnclaveArmourShieldScriptEffect ;©Tyranick short ShieldEffect short InCombat Begin OnEquip player Set ShieldEffect to 1 end Begin OnUnequip Set ShieldEffect to 0 end Begin GameMode If Player.GetEquipped ArmorTeslaPower == 1 && ShieldEffect == 1 && if player.GetActorValue ActionPoints >= 1 SetActorValue DamageResist 75 SetActorValue PoisonResist 75 SetActorValue FireResist 75 SetActorValue EnergyResist 75 ElseIf player.GetActorValue ActionPoints <= 0 Set ShieldEffect to 0 Endif End Does that look OK to apply the shield effect as soon as the armour is equipped? Anyway, my next issue is assignment: Basically...I want my script to work in the way that, "When enemy does damage to you, ALSO subtract that amount of damage from AP's as long as the player has AP's" so say a gun does 30 damage, i only take 30% so 9 damage, now I also want that amount to be taken off the AP at the same time as long as I have some AP's...how would I do this? Would it need to be something like: Begin OnHit if player.GetActorValue ActionPoints >= 1 ; name of command that references enemy weapon damage here DamageActorValue ActionPoints; value that means "same as amount of damage done to player" goes here EndIf End I can't find what the variables are so I was wondering if I'd need to use this FOSE function to specify? Such as "GetAttackDamage" ; *then reference the weapon here, then the damage* for every individual weapon? Or is there just some simple command already in vanilla that I should use (I'm guessing)? Thanks in advance :). Link to comment Share on other sites More sharing options...
†TYRANICK†™ Posted January 6, 2009 Author Share Posted January 6, 2009 edited Link to comment Share on other sites More sharing options...
†TYRANICK†™ Posted January 7, 2009 Author Share Posted January 7, 2009 Bump! Edited: Yeah, I need to know how to disable my script effect when the armor is taken off (as well as has less that 0 AP left) I've tried "RemoveItem" and "OnUnequip" and "UnEquipItem" and none of them seem to disable the effect, it just remains on. Here is what I have so far: scn EnclaveArmourShieldScriptEffect short ShieldEffect ;©Tyranick Begin OnEquip player Set ShieldEffect to 1 end Begin OnUnequip Set ShieldEffect to 0 end Begin GameMode if ShieldEffect == 1 player.SetActorValue DamageResist 75 player.SetActorValue PoisonResist 75 player.SetActorValue FireResist 75 player.SetActorValue EnergyResist 75 Set ShieldEffect to 0 if player.GetEquipped ArmorEnclave == 1 && player.GetActorValue ActionPoints >= 1 Set ShieldEffect to 1 ElseIf player.GetActorValue ActionPoints <= 0 ElseIf player.OnUnequip ArmorEnclave == 1 Set ShieldEffect to 0 Endif Endif EndIf End Hopefully (bar the incorrect reference to "OnUnEquip" The above script should make it so, when I equip the armour it adds the shield effect. Then it checks to make sure I have the armour on and I have more than 1 AP available, If so it enables the above "effects" for me "shield" or if I don't have any available AP's or Un equip the armour, the effects aren't applied or they are turned off when i run out of AP's or I take off the armour. That's correct yeah? And for the next bit: if player.GetActorValue ActionPoints >= 1 ;©Tyranick if doonce == 0 set damagetaken to player.getav actionpoints set doonce to 1 endif if actionpoints > 0;so it only works when there's shield if timer > 0 set timer to timer - 15 else set damagetaken to player.getav health if actionpoints < 0 player.restoreav actionpoints 1 endif set timer to 1 endif endif else set doonce to 0 endif ^ That next bit is that I have AP's. Next it enables it so damage taken also deducts AP's. Then when I run out of action points, and there's no current timer, it waits for 15 seconds before re-enabling AP regeneration, and in the mean time it resets it so I take damage as normal without any effect to AP (because I have none left currently), then when the timer is up it checks that my AP is still less that 0, so it re-enables the regeneration, shuts of the timer, and the do once thing. I need to add some effect that checks if im in combat, and disables regeneration until I’m out of combat completely. But yeah...the problem arises is that in the second script...I don’t know the variable equivalent of "damagetaken" so naturally it doesn't work ><! Also I need to know if the second script is even right at all or I’m doing it totally wrong...which is what I'm guessing. I'm totally new to all this and I owe thanks to many people for helping me up to this point, but I need this one last push to get me sorted, and to stop bugging you all :P. Thanks to anyone again in advance :) Link to comment Share on other sites More sharing options...
ar13 Posted January 7, 2009 Share Posted January 7, 2009 I would make an effect for the damage resistance and then use addspell and removespell to control whether it's active. ie:Begin OnEquip player if player.GetActorValue ActionPoints >= 1 Set ShieldEffect to 1 player.addspell youreffectname endif end Begin OnUnequip Set ShieldEffect to 0 player.removespell youreffectname end Begin GameMode ; if shield on and ap < 1, turn shield off if ShieldEffect == 1 && player.GetActorValue ActionPoints < 1 Set ShieldEffect to 0 player.removespell youreffectname endif ; if shield off and ap > 1, turn it on, add your in combat check here if ShieldEffect == 0 && player.GetActorValue ActionPoints >= 1 Set ShieldEffect to 1 player.addspell youreffectname endif endThis is only intended to be an illustration, it probably would need touching up to run. Link to comment Share on other sites More sharing options...
betto212 Posted January 7, 2009 Share Posted January 7, 2009 would be nice put this with a personal force field effect... something like the "maximum armor " of crysis but with a force field that waste ap.. Link to comment Share on other sites More sharing options...
†TYRANICK†™ Posted January 7, 2009 Author Share Posted January 7, 2009 I would make an effect for the damage resistance and then use addspell and removespell to control whether it's active. ie:Begin OnEquip player if player.GetActorValue ActionPoints >= 1 Set ShieldEffect to 1 player.addspell youreffectname endif end Begin OnUnequip Set ShieldEffect to 0 player.removespell youreffectname end Begin GameMode ; if shield on and ap < 1, turn shield off if ShieldEffect == 1 && player.GetActorValue ActionPoints < 1 Set ShieldEffect to 0 player.removespell youreffectname endif ; if shield off and ap > 1, turn it on, add your in combat check here if ShieldEffect == 0 && player.GetActorValue ActionPoints >= 1 Set ShieldEffect to 1 player.addspell youreffectname endif endThis is only intended to be an illustration, it probably would need touching up to run. Omg...THANKYOU! That's a much better way of doing it, thankyou very much ^^! I Know my script on the "AP" drain to damage is totally wrong....can anyone reccomend a method for doing it correctly? As probably identified, some people suggested doing something thats checks player damage, then adds it back and subtracts that many actions points but, I can see numerous issues with that such as it not updating correctly during ons and offs etc. Link to comment Share on other sites More sharing options...
†TYRANICK†™ Posted January 8, 2009 Author Share Posted January 8, 2009 Hey!! I just had a revelation of an idea, which would save upon forcing horrible script effects on the player directly via "SetActorValue" Ok...here's my idea. What if instead of doing and addspell containing "increase DR to x" or "Increase fire resistance to X". Why don't I just increase the resistance directly from Small Guns/Big guns/EnergyWeapons/Explosives etc etc? Could that work? I already set up a new effect called "SmallGunsResistance" and in the base effect attributes I have: ID: IncreaseSMResName: Increase Small GunsEffect Archetype: VALUE MODIFIERAssoc. Item: Small GunsResist Value: Damage Resistance If I was to add the effect to a new spell, set the magnitude to say...75. Add the spell to my armor, would that mean that whenever I get damaged by small guns I would only take 25% damage from them? Damn I hope that method could work, would make my shield effect that bit more manageable :) Anyone any ideas? Thanks for the help again so far. @ Betto We'll see ;) Link to comment Share on other sites More sharing options...
SpeedyB64 Posted January 8, 2009 Share Posted January 8, 2009 This has so many applications! Special armor and Halo of course. I will fiddle with the script and effects and make something cool (maybe add a visible effect with animations for regen and hits). Link to comment Share on other sites More sharing options...
†TYRANICK†™ Posted January 8, 2009 Author Share Posted January 8, 2009 Hey! Don't steal it dude, if your going to "fiddle" at least help me first since I havn't even got it fully worked out yet and it's not fair for someone to come along, pick it up and then do what ever the hell they like...¬¬. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.