Jump to content

Quest Script not running?


ozziefire

Recommended Posts

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 refRegen

ref refOwner

 

Begin GameMode

set 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

EndIf

End

Edited by ozziefire
Link to comment
Share on other sites

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 by Skevitj
Link to comment
Share on other sites

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 point

Thanks for the reply :)

Link to comment
Share on other sites

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

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

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

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 by ozziefire
Link to comment
Share on other sites

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...