Pikmin Posted February 8, 2008 Share Posted February 8, 2008 I'm writing new force powers that combine existing effects. The first attempts to push enemies and apply the whirlwind effect to simulate the effect of someone squirming while being pushed. I want to make sure my script will work: #include "k_inc_force" // Include file of the original Bioware Force Scripts // We are including this to gain access to a number of very useful functions // developed by Bioware // See Notes below int FORCE_POWER_UNLEASHED_PUSH = 283; // This variable must match the Row ID of your power in spells 2da, so change this to match your spells.2da void main() { /*****************************************/ /* STEP 1 - DECLARE THE VARIABLES NEEDED */ /*****************************************/ object oTarget = GetSpellTargetObject(); // This will set oTarget equal to who you cast the spell at // In this case it will be yourself SWFP_HARMFUL = TRUE; // The variable SWFP_HARMFUL has already been declared in the include file // It is used by the signal event command to let the target know if this is // an attack spell or not. /****************************************/ /* STEP 3 - SIGNAL THE SPELL CAST EVENT */ /****************************************/ // Signal SpellCast Trigger SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL)); /**********************************/ /* STEP 4 - DETERMINE THE EFFECTS */ /**********************************/ // Build Visual Effects // These are the visual effects that will be played when the spell is cast // A listing of all visual effects is in the 2da visualeffects ePush1 = EffectForcePushed(); ePush2 = EffectLinkEffects(ePush1, EffectVisualEffect(VFX_IMP_FORCE_PUSH)); ePush3 = EffectWhirlWind(); ePush4 = EffectLinkEffects(ePush3, EffectVisualEffect(VFX_IMP_FORCE_WHIRLWIND)); effect eDamage = EffectDamage(SWFP_DAMAGE, SWFP_DAMAGE_TYPE); } /******************************/ /* STEP 5 - APPLY THE EFFECTS */ /******************************/ ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FORCE_PUSH), oTarget)); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FORCE_WHIRLWIND), oTarget)); } The second adds the lightning effect to force wave so that it appears the enemies are pushed away by the lightning: #include "k_inc_force" // Include file of the original Bioware Force Scripts // We are including this to gain access to a number of very useful functions // developed by Bioware // See Notes below int FORCE_POWER_UNLEASHED_LIGHTNING = 282; // This variable must match the Row ID of your power in spells 2da, so change this to match your spells.2da void main() { object oTarget = GetSpellTargetObject(); // This will set oTarget equal to who you cast the spell at // In this case it will be yourself SWFP_HARMFUL = TRUE; // The variable SWFP_HARMFUL has already been declared in the include file // It is used by the signal event command to let the target know if this is // an attack spell or not. // Signal SpellCast Trigger SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), SWFP_HARMFUL)); // Build Visual Effects // These are the visual effects that will be played when the spell is cast // A listing of all visual effects is in the 2da visualeffects effect eWave = EffectVisualEffect(VFX_FNF_FORCE_WAVE); effect eLightning = EffectBeam(VFX_BEAM_LIGHTNING_DARK_L, OBJECT_SELF, BODY_NODE_HAND); //Apply Visual Effects - they will last 3 seconds ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLightning, 9.0); ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FORCE_WAVE), GetLocation(OBJECT_SELF)); } I would like help to make sure these scripts execute the proper functions. Thankyou. Link to comment Share on other sites More sharing options...
lactose_ Posted February 8, 2008 Share Posted February 8, 2008 Hmm, why don't you test if they compile first and see if they work in-game? If there are issues that require troubleshooting you could then post the problems here. I think they look mostly sound though. Link to comment Share on other sites More sharing options...
Pikmin Posted February 8, 2008 Author Share Posted February 8, 2008 I tested them all, none of them compile. Kotortool says something about syntax error but I'm not sure where, and I've done a lot of K2 scripting. Link to comment Share on other sites More sharing options...
lactose_ Posted February 8, 2008 Share Posted February 8, 2008 Copy and paste the (syntax) error message here and it'll be easier for others to locate the problem. Link to comment Share on other sites More sharing options...
Darkkender Posted February 8, 2008 Share Posted February 8, 2008 Are you trying to compile the k_inc_force.nss file? if so you are getting the error because that is an include file and not the actual spells script. Also I noticed you are using "|" for or and not "||" this will also likely throw syntax errors when compiling. Link to comment Share on other sites More sharing options...
Pikmin Posted February 8, 2008 Author Share Posted February 8, 2008 Edited. Link to comment Share on other sites More sharing options...
Darkkender Posted February 8, 2008 Share Posted February 8, 2008 So you need to post the source from the script files so we can better assist you with troubleshooting. You're giving us errors for broken scripts and the changes in k_inc_force.nss, but nothing from your actual scripts themselves. All of the errors I'm seeing listed are all related to incorrect syntax usage and not declaring variables before or multiple variable declarations. Link to comment Share on other sites More sharing options...
Pikmin Posted February 8, 2008 Author Share Posted February 8, 2008 In the first post I have the script source of the scripts for my custom powers encased in the code field. Link to comment Share on other sites More sharing options...
Darkkender Posted February 8, 2008 Share Posted February 8, 2008 Where is the "void main()" portion of your script? There is alot you are leaving out from your script either to hide what your doing from others in attempt to keep others from stealing the work or because your just cutting and pasting from other scripts without knowing what else needs to be included. If it is the first of those 2 reasons show us everything so we can help you. If it is the second reason and everything you have posted above is the entire script then your missing alot of parts to your script. Link to comment Share on other sites More sharing options...
Pikmin Posted February 8, 2008 Author Share Posted February 8, 2008 It's kinda both. I tried following the force power tutorial but it didn't cover attack powers. I'll post the full script in a min. Link to comment Share on other sites More sharing options...
tk102 Posted February 9, 2008 Share Posted February 9, 2008 CASE statements must reside within a SWITCH block. In the case of k_inc_force.nss, they reside within switch (GetSpellId()) { ... } You don't need to do any SWITCH / CASE branching in a custom script. It looks like you've tried to excise a section of k_inc_force changed a little and tried to get it to stand on its own. A better approach would be script the new force power from scratch with the k_inc_force as a reference, creating your own constants, "saving throw" subroutines, etc. Alternatively you could create a CASE branch in k_inc_force.nss Sp_RunForcePowers subroutine. You get the advantage of being able to use k_inc_force subroutines and constants, but you have to hardcode the spells.2da row that you end up using for your force power. Link to comment Share on other sites More sharing options...
Pikmin Posted February 9, 2008 Author Share Posted February 9, 2008 Ok, I got Grip Impale and Grip Lightning working. But I can't figure out the problems on Unleashed Push and Unleashed Lightning. i've rewritten those two scripts and their source is posted in the main post. Link to comment Share on other sites More sharing options...
Darkkender Posted February 9, 2008 Share Posted February 9, 2008 Unleashed push has alot of ePush variables without any declaration of the variables. Such as "ePush1 = EffectForcePushed();" this should be "effect ePush1 = EffectForcePushed();" unless it has been previously declared in another program as a global variable. It would also be good if you showed us what the new error reports are with the scripts since you made your changes. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.