Guest Posted May 6, 2014 Posted May 6, 2014 Spells are very very handy. But I would like to add that concerning the way they are used they could create unfortunate issues that makes me avoid start effect and finish effect, preferring some redundant code in the update block (if I didn't do it >>> do it) so that it can run the same code some times until the condition is really true
Guest tomm434 Posted May 6, 2014 Posted May 6, 2014 Spells are very very handy. But I would like to add that concerning the way they are used they could create unfortunate issues that makes me avoid start effect and finish effect, preferring some redundant code in the update block (if I didn't do it >>> do it) so that it can run the same code some times until the condition is really true yep, thanks, I wasn't even thinking about it that way. I still can't comprehend that Effect script runs every frame instead of every [some amount of time].
Guest Posted May 6, 2014 Posted May 6, 2014 it's like npc or item scripts, they all run every frame. Tendentially I avoid to misuse them for that reason. At least a spell is usually supposed to end
Guest tomm434 Posted May 10, 2014 Posted May 10, 2014 How can I use script variable from Effect in Quest script? Geck says that there is a sybtax error I have effect script named aaamq05ghoulsafterPlayerCapturedCutsceneEffectScript In effect script there is a reference "ref cloneref" How do I place condition in my quest script using this reference? aaamq05ghoulsafterPlayerCapturedCutsceneEffectScript.cloneref.isactor ==1 -this doesn't work "aaamq05ghoulsafterPlayerCapturedCutsceneEffectScript.cloneref".isactor == 0 -doesnt work either.
Halstrom Posted May 10, 2014 Author Posted May 10, 2014 How can I use script variable from Effect in Quest script? Geck says that there is a sybtax error I have effect script named aaamq05ghoulsafterPlayerCapturedCutsceneEffectScript In effect script there is a reference "ref cloneref" How do I place condition in my quest script using this reference? aaamq05ghoulsafterPlayerCapturedCutsceneEffectScript.cloneref.isactor ==1 -this doesn't work "aaamq05ghoulsafterPlayerCapturedCutsceneEffectScript.cloneref".isactor == 0 -doesnt work either. You can't read Dialogue, Object or Effect script variables from other scripts but you can set other variables from those scripts so you have 3 choices: 1. You can create a quest variable in your quest script and set that from the effect script (normal recommended way) 2. You can create a global variable and do the same as above, only advantage as far as I know is I can be a lot shorter in name. In both of the above, any mod using this mod as a master can read that variable. 3. If you mod uses NVSE, you can create an NX variable and it can be read from any other script or mod without requiring your mod as a master. I'd only do this if used a lot throughout your mod or you wanted it to be adjustable or read by other mods as they are saved in a save file with game saves and aren't deleted or reset to 0 unless you do so deliberately. Also if you create a variable in a quest script you use the name of the quest as the ref, not the name of the script. I'd also for that reason try keeping your quest names a little shorter, more letters may help for clarity sometimes but means more chance of typo's, you are better off putting a short comment at the start of the script explaining what it does
Guest tomm434 Posted May 10, 2014 Posted May 10, 2014 Thanks. I agree that name objects shouls be shorter but when I tried to do that from the very beginning(when I was bulding my "system" of naming objects, variables) but at some point I realized that I don't understand what particular object meant. So, I decided not to cut down the names from that moment.
Halstrom Posted May 10, 2014 Author Posted May 10, 2014 Thanks. I agree that name objects shouls be shorter but when I tried to do that from the very beginning(when I was bulding my "system" of naming objects, variables) but at some point I realized that I don't understand what particular object meant. So, I decided not to cut down the names from that moment. Whatever you need to do to understand is good, but the script size in NV GECK isn't very big (600-900 lines dependant on size of lines) so if you get into big stuff later you will start shortening it by necessity
nyaalich Posted May 10, 2014 Posted May 10, 2014 Actually, you can reference and object's script variables in NV (condition GetScriptVariable). Not in FO3, iirc. That way you can get an NPC's vars (or at least that how I've used it).
Guest tomm434 Posted May 10, 2014 Posted May 10, 2014 Thanks. Let's hope GetScriptVariable works with references.
Guest Posted May 10, 2014 Posted May 10, 2014 it should, but I'm not sure if it will work on a clone. How can you inject the script, attaching it to Player and PlayerFemale by GECK?
Guest tomm434 Posted May 10, 2014 Posted May 10, 2014 Technicaly, player clone is a declared reference. set cloneref to player.placeatme 7 1 Why do you think it won't work?
Guest Posted May 10, 2014 Posted May 10, 2014 where do you attack the script, in the Player and PlayerFemale Object inside the GECK? this is what I mean
Guest tomm434 Posted May 10, 2014 Posted May 10, 2014 I don't understand what you mean. I moved playercloneref to Spell(to Effect Script if to be certain). I'll try and make another reference in quest script and when time comes, set playercloneref1(reference of quest script) to aaamq05ghoulsafterPlayerCapturedCutsceneEffectScript.cloneref Then I'll delete them all.
Guest Posted May 10, 2014 Posted May 10, 2014 Actually, you can reference and object's script variables in NV (condition GetScriptVariable). Not in FO3, iirc. That way you can get an NPC's vars (or at least that how I've used it). ^^^ Because I assume she was meaning attaching a script on the NPC Base ID and then referring to its variables pointing to the its reference, in the same way you do when you manage companions' variables for example. So you attach a script on the Base ID of a NPC, with some variables, then you call them using NPCREF.nameofvariable. It's like for quests, but applied on NPC references. When checking conditions like for example inside a package or a dialogue, for quests you use GetQuestVariable, for NPCs you use GetScriptVariable
Guest Posted May 11, 2014 Posted May 11, 2014 This is getting me crazy... how do I print to console or messageex or whatever, a reference? I need to check the value of a result in a function: let playeritemREF := player.getequippedobject currentslot I know currentslot value, it's a number, now I need to understand which value playeritemREF takes. I tried with messageboxex $playeritemREF but didn't work
nyaalich Posted May 11, 2014 Posted May 11, 2014 Are you looking for its name or its number? "%i " var should give you the name of the ref (away from comp so can't research properly)
prideslayer Posted May 11, 2014 Posted May 11, 2014 PrintC if you want to be spammy, dbPrintC if not. You have to turn debugmode on for your mod to use the latter, but it's nicer to do it that way if you leave the prints in when you release. e.g. "PrintC "ref: %x" playeritemREF" will print playeritemref as a hex value to the console. Look at the format specifiers in the NVSE/FOSE documentation for more. http://fose.silverlock.org/fose_command_doc.html
Guest Posted May 11, 2014 Posted May 11, 2014 thank you. Yes i don't mind to be spammy because I use them only while I'm looking for mistakes. Is there a way to visualize automatically its text value instead of hex value? or should I GBO the hex value? EDIT: nyaalich, %i gives the name of the ref as text or ... ffxxxxxx?
prideslayer Posted May 11, 2014 Posted May 11, 2014 %i gives the name, if it's actually a reference. I'll be blank if not. I usually print both if I'm not sure i'm getting a reference when I expect one. PrintC "ref: %i (%x)" ref ref Google printf so you can understand how to construct the strings, if you don't already, and scroll down the link I posted to the format specifiers (near the bottom) to see other things you can use there.
Guest Posted May 11, 2014 Posted May 11, 2014 thank you prideslayer, that's absolutely clear. I always dig things on google or guides before posting, in this case I had issues understanding %letter thing, I often have troubles understanding NVSE docs
nyaalich Posted May 11, 2014 Posted May 11, 2014 Don't forget about http://www.gribbleshnibit.com/projects/NVSEDocs/#Format_Specifiers. Lots of good cheat sheets on there for geck variables, etc.
Guest Posted May 11, 2014 Posted May 11, 2014 That's the documentation that troubles me ... when I see things like "%r - replaced by a new-line character (takes no arguments)" I don't get the meaning. I already have read that, nyaalich, so for example the first question was "where does it write about %f...?", I guess I missed it
nyaalich Posted May 11, 2014 Posted May 11, 2014 MessageBoxEx "Variable1 = %g and Variable2 = %i" var1 var2 ;Appears as... ;Variable1 = (the value of var1) and Variable2 = (the value of var2) ;Add %r (a return, essentially) to break it into different lines MessageBoxEx "Variable1 = %g %r and Variable2 = %i" var1 var2 ;Appears as... ;Variable1 = (the value of var1) ;and Variable2 = (the value of var2) ;"Takes no arguments" means that it isn't expecting to read a variable in unlike %g and %i etc. ;unlike the other ones, it already knows that %r = the character that means "make a new line" when you press the Enter / Return key
prideslayer Posted May 11, 2014 Posted May 11, 2014 That's the documentation that troubles me ... when I see things like "%r - replaced by a new-line character (takes no arguments)" I don't get the meaning. The %'s are placeholders for the variable that come after the string. %r puts a newline (a return/enter) and thus, does not require a variable. Normally 'printc "%x"' is invalid by itself, you need a variable after the string that it will put in the spot for X (they are all handled in order). %r is "special" and does not use a variable, it's just a placeholder for a newline since you can't actually put a newline in the string. There's another one like that which just means a blank line IIRC.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now