ozziefire Posted April 5, 2011 Share Posted April 5, 2011 (edited) I've dropped the following script into a GeckNV quest and ticked the StartGameEnabled but it doesn't seem to want to run, it is a quest script, any ideas? Thx for looking :) ScriptName SuperHeroQUESTSCRIPT int refRegenref refOwner Begin GameModeset refOwner to player If player.IsInInterior == 0 If GameHour > 6 If GameHour < 18 Set refRegen to ScriptEffectElapsedSeconds * 10 refOwner.RestoreAv Health refRegen refOwner.RestoreAv Fatigue refRegen refOwner.RestoreAv Hunger refRegen refOwner.RestoreAv Dehydration refRegen refOwner.RestoreAv LeftAttackCondition refRegen refOwner.RestoreAv RightAttackCondition refRegen refOwner.RestoreAv LeftMobilityCondition refRegen refOwner.RestoreAv RightMobilityCondition refRegen refOwner.RestoreAv EnduranceCondition refRegen refOwner.RestoreAv PerceptionCondition refRegen EndIf EndIf EndIfEnd Edited April 5, 2011 by ozziefire Link to comment Share on other sites More sharing options...
Skevitj Posted April 5, 2011 Share Posted April 5, 2011 (edited) Don't know if it's the problem, but why are you assigning "player" a variable? "player" is the variable with the player's reference in it by definition, assigning it to another is redundant. Just call them player.Reso... as you did for IsInInterior. Available only in Effect Scripts. quest =/= effect. That should be it. Edited April 5, 2011 by Skevitj Link to comment Share on other sites More sharing options...
ozziefire Posted April 5, 2011 Author Share Posted April 5, 2011 Don't know if it's the problem, but why are you assigning "player" a variable? "player" is the variable with the player's reference in it by definition, assigning it to another is redundant. Just call them player.Reso... as you did for IsInInterior.Hmm good point I'll give that a go, I originally tried running the script in an effect on armor and had intended it to work for NPC's as well and missed changing that player bit when rehashing it at some pointThanks for the reply :) Link to comment Share on other sites More sharing options...
rickerhk Posted April 5, 2011 Share Posted April 5, 2011 it might be running - just not doing anything because ScriptEffectElapsedSeconds will be returning zero since it's only valid in a ScriptEffectUpdate block. You probably want to use GetSecondsPassed in a Quest gamemode block. http://geck.bethsoft.com/index.php/ScriptEffectElapsedSeconds Link to comment Share on other sites More sharing options...
ozziefire Posted April 5, 2011 Author Share Posted April 5, 2011 Cool got that version running fine, but now trying to get a version running that is a effect inside a piece of armor, but it doesn't seem to work, I would also like it to work on the player or any npc wearing it (for the relevant stats) and am trying to find the "GetOwner" function to do so. Thanks for looking :) ScriptName SuperRegenSCRIPT int MicroRegen ref refOwner Begin ScriptEffectUpdate Set refOwner to player If GameHour > 7 If GameHour < 17 Set MicroRegen to ScriptEffectElapsedSeconds * 5 refOwner.RestoreAv Health MicroRegen refOwner.RestoreActorValue Fatigue MicroRegen refOwner.RestoreActorValue Hunger MicroRegen refOwner.RestoreActorValue Dehydration MicroRegen refOwner.RestoreAv LeftAttackCondition MicroRegen refOwner.RestoreAv RightAttackCondition MicroRegen refOwner.RestoreAv LeftMobilityCondition MicroRegen refOwner.RestoreAv RightMobilityCondition MicroRegen refOwner.RestoreAv EnduranceCondition MicroRegen refOwner.RestoreAv PerceptionCondition MicroRegen EndIf EndIf End Link to comment Share on other sites More sharing options...
rickerhk Posted April 6, 2011 Share Posted April 6, 2011 If the script is on an object in a container (actor or container) then you want to use GetContainer to get the reference of the actor Set refOwner to GetContainer On the base effect that the script is attached to, you want to make sure 'self' is checked. Are you doing it as an object effect, or an actor effect? Link to comment Share on other sites More sharing options...
ozziefire Posted April 6, 2011 Author Share Posted April 6, 2011 (edited) If the script is on an object in a container (actor or container) then you want to use GetContainer to get the reference of the actor Set refOwner to GetContainer On the base effect that the script is attached to, you want to make sure 'self' is checked. Are you doing it as an object effect, or an actor effect?Was doing it as an object effect, didn't realise it could also be an actor effect, have to consider that I guess, it's just a supersuit that regenerates the actor wearing it when in sunlight. Maybe it should be an Actor Effect? Edited April 6, 2011 by ozziefire Link to comment Share on other sites More sharing options...
rickerhk Posted April 6, 2011 Share Posted April 6, 2011 I would try doing it as an actor effect - add the effect on equip, remove the effect if unequipped or dropped. Probably as an ability.The problem with object effects is they stack (multiply) if you put the item on another actor - especially companions. Link to comment Share on other sites More sharing options...
ozziefire Posted April 6, 2011 Author Share Posted April 6, 2011 I would try doing it as an actor effect - add the effect on equip, remove the effect if unequipped or dropped. Probably as an ability.The problem with object effects is they stack (multiply) if you put the item on another actor - especially companions.Cool, thanks, tha's what I ended up fumbling into anyway but I didn't know they stacked, cool little nugget of info that may have taken me a heap to work out :) Link to comment Share on other sites More sharing options...
Recommended Posts