Quick question: What would happen if I called DeleteReference on an object to which the object script was attached to, like:
scn ANRLVarlaStoneLightScriptBegin OnActivate playerdisableDeleteReferenceplayer.AddItem VarlaStone 1End
Since I've just removed what the script is running on, will the player.additem line not run, or will the script terminate on completion?
I have not tested this. I will if you don't.
FYI, at least one frame must pass between the call to Disable and the call to DeleteReference. The ref must be disabled at the time deleteReference is called, and disable doesn't kick in until the next frame at the earliest.
More specifically the ref is queued for disabling and not actually disabled until the task manager gets around to doing so - generally the next frame but not guaranteed.
DeleteReference operates similarly (as do other commands like PlaceAtMe, RemoveMe, etc); in general you should structure your script with a state variable rather than rely on frame counting e.g.
scn ANRLVarlaStoneLightScriptshort state; 1=disabled 2=deletedbegin gamemode if state == 2 return elseif state == 1 if GetDisabled DeleteReference set state to 2 return endif endifendBegin OnActivate player player.AddItem VarlaStone 1 disable set state to 1End
Did some testing on optional arguments - Didn't see any screw ups. The local variable that stores the argument remains uninitialized and the function doesn't have any issues with that. In essence, un-passed (leading) arguments practically pass 0 to the function.
Any chance of proper support in 18 Final ?
I assume you are using a ref variable as a function pointer to get around the compiler complaining about missing arguments?
Don't rely on this behavior, please. It is not supported.
Optional function arguments won't be present in 0018 final. When they are supported you'll be allowed to specify default values rather than defaulting to zero.
GetBookSkillTaught can only be used with base objects, despite what the docs claim?
Let b := r.GetBaseObjectPrint "Skill: " + $GetBookSkillTaught b
is fine, but this isn't :
Print "Skill: " + $r.GetBookSkillTaught
EDIT:
From the Command Doc:
I'm only seeing the correct result in an if eval with -1.
Docs are wrong, GetBookSkillTaught returns -1.
What does your second Print statement actually print?
Any chance of removing the string echo to the console when sv_Construct or sv_Set are used from batch scripts?
Sure.
Bug report repost - Let allows using ;= as an operator.
Semicolon is indicating a comment, the rest of the line is ignored. It probably sneaks by the compiler by luck (last byte of your expression happens to be equivalent to an assignment operator opcode).
Put me out of my misery and tell me honestly....does cloneform work at all with statics?
It ought to. What's wrong?