Siegfoult Posted March 10, 2011 Share Posted March 10, 2011 I am new to scripting, and I wrote a simple effect script to allow a weapon to knock targets back: ScriptName ForceOfNatureScript Begin ScriptEffectStart{tab here} Player.PushActorAway Target 100End The script will not save, although it will save if I change 'Targer' to 'Player' but even in that case, I do not see this script listed when trying to add it to the 'Object Effect' part of editing a weapon. Thank you for your consideration, I find it frusterating that FNV GECK provides no error messages for faulty scripts. I am basing my script on the "pusheffect" script from the website: http://geck.bethsoft.com/index.php/Useful_Scripts Link to comment Share on other sites More sharing options...
davidlallen Posted March 10, 2011 Share Posted March 10, 2011 (edited) Please use "geck powerup" to see syntax errors when editing scripts. You can find this at newvegasnexus. In the script editor window, there is a dropdown to set the type of script, with choices quest, object or effect. Please make sure "effect" is selected in the dropdown, and then save the script before opening the weapon dialog to choose it. I am not sure about the "target" keyword in the example you linked, I have not done that before. *Possibly* when you select "effect" in the dropdown, then the target keyword is magically defined. If not, I do not know how the linked example works. Edited March 10, 2011 by davidlallen Link to comment Share on other sites More sharing options...
rickerhk Posted March 10, 2011 Share Posted March 10, 2011 A script effect can be used on a base effect, which can then be used on an object effect or actor effect. But to be able to do anything, you need a way to define what Target is. It needs to be defined as a ref variable, then you need a function that can get that value when hit it with a weapon. NV has a new function GetOwnerLastTarget http://geck.bethsoft.com/index.php/OnHit to do this. I think if you look at how a certain weapon is set up - I think it's mis-fortune - something like that, does what you want. Use that as an example. Link to comment Share on other sites More sharing options...
davidlallen Posted March 10, 2011 Share Posted March 10, 2011 Curiously, the page linked in the OP uses Target, without ever declaring it, let alone assigning it a value. The definition at the wiki for GetOwnerLastTarget is ... incomplete, but perhaps your suggestion of searching for it in the game code (using edit -> find text btw) is the right approach. Link to comment Share on other sites More sharing options...
Siegfoult Posted March 10, 2011 Author Share Posted March 10, 2011 Reading the script for Miss Fortune's gun effect seems to cover all of my problems, and is also giving me a demonstration for other useful functions, thanks for the tip. Link to comment Share on other sites More sharing options...
Recommended Posts