rondivu Posted January 1, 2009 Share Posted January 1, 2009 Hello! HAPPY NEW YEAR! :thumbsup: ANYWAYZFor the past few days/weeks I have been working on an idea for my own character, and have been scripting/testing it for a while. I recently read up on Deadly Reflex on what they did and I threw some of my ideas away because they already did a good job of some of what I was going to do. I focused it on Hand to hand combat. The idea being that because hand to hand doesn't get those enchantments like weapons, I wanted to see if I could create special attack/abilities for it. I KNOW that there is a mod for gauntlets that do onstrike spells (which I have used)... but, I didn't want to JUST wear gloves, then have abilities, but rather fighting abilities for just BEING in hand to hand combat (even without gauntlets). To accomplish this I have added a few abilites during certain conditions when in combat and in h2h, that amplifies the users capability. Recently, I just figured out how to use scripted buttons and made it work for me (with shaders whenever pressed). But here is the major steps that I have taken to get the button to do special ability attacks: 1) Player is added a scripted spell that detects when the player presses V. Pressing V uses an animation (power attack back). When player DOES this, it adds a TOKEN to player. 2) Token then adds a spell to player, then removes itself 3) Spell Ability checks whether there is a target (I use getcrosshairref), whether the character is in hand to hand mode, checks certain animation from step one (I will reevaluate wether it needs the Hand to hand mode) THEN it adds a spell ABILITY to target. Then removes itself. 4) This NEXT spell ability is added onto the target (but checks whether that target is player or not), then gets the Activator to Cast a spell at this target. Then removes itself. :unsure: My questions is: should I effectively MERGE steps 2 & 3, by having the token do the checks of when added, also checking the animation and h2h instead of having the ability do the checks? It would probably be more efficient, but please let me know what you think. Other thoughts were: if the token is added to player inventory, when I use "OnAdd Player" and after I gave the ability to player/enemy, would checking that ability be immediate, or would i have to write another BEGIN to check that ability. By doing so I want to be able to effectively remove the token once the ability is added. Thank you scripters and fellow modders. Hope you guys can answer my questions (and ease my troubles :biggrin: ) Link to comment Share on other sites More sharing options...
LoginToDownload Posted January 2, 2009 Share Posted January 2, 2009 OnAdd's entry in the Construction Set Wiki suggests that you need to keep the item in the inventory for at least one frame for OnAdd blocks to run. If you wanted to, you could probably do the whole thing in one Quest script. When V is pressed and IsAttacking is 0, do the AttackBackPower animation, set IsAttacking to 1, and set fQuestDelayTime to 0.1 (Only if the player is using Hand to Hand?). Then, in a GameMode block, tick a timer up (using GetSecondsPassed or normally) when IsAttacking is 1. Once it reaches whatever value the blow would land at, use GetCrosshairRef (Great function, by the way. I had never heard of it. Many thanks) to figure out what the victim is. Check if it's an Actor, resistances, etc, and if it's an acceptable victim, do the special attack by casting via activator. Then reset IsAttacking and the timer. Happy new year. :) Link to comment Share on other sites More sharing options...
rondivu Posted January 2, 2009 Author Share Posted January 2, 2009 OnAdd's entry in the Construction Set Wiki suggests that you need to keep the item in the inventory for at least one frame for OnAdd blocks to run. If you wanted to, you could probably do the whole thing in one Quest script. When V is pressed and IsAttacking is 0, do the AttackBackPower animation, set IsAttacking to 1, and set fQuestDelayTime to 0.1 (Only if the player is using Hand to Hand?). Then, in a GameMode block, tick a timer up (using GetSecondsPassed or normally) when IsAttacking is 1. Once it reaches whatever value the blow would land at, use GetCrosshairRef (Great function, by the way. I had never heard of it. Many thanks) to figure out what the victim is. Check if it's an Actor, resistances, etc, and if it's an acceptable victim, do the special attack by casting via activator. Then reset IsAttacking and the timer. Happy new year. :)Dumb question but, when ur doing the animation does that count as an attack or just an animation sequence? Because i know the animation doesn't technically hurt anything...I will try it this way... hopefully without too much errors! Trial and errors seems the best way, but i really hope i don't bloat a saved game with this. THANK YOU!! Link to comment Share on other sites More sharing options...
LoginToDownload Posted January 2, 2009 Share Posted January 2, 2009 Much to the dismay of people trying to make shape-shifting mods, attack animations played with PlayGroup don't actually cause an attack. I'd reccommend dumping a Persistent activator in a holding cell to get around bloating. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.