Jump to content

Need for script


Leodoidao

Recommended Posts

Greetings.

 

I´m in need of two very simple scripts that I just cannot make them work in my quest.

 

1- If a given NPC is killed the quest goes to next stage

 

(????????????????) && (GetStage AAquest03 == 10)

setstage AAquest03 20

endif

 

2- In case a certain container is activated during a certain quest stage, something (some ashen remains) is removed from my inventory and quest goes to next stage

 

(?????????) && (GetStage AAquest03 == 40)

 

player.removeitem AAashenremains

setstage AAquest03 50

endif

 

What would be (???????) for 1 and 2?

 

NOTE: in case 2, it might be placing the item AAashenremains in this given container (AAmysticurn)

 

:confused:

Link to comment
Share on other sites

Greetings.

 

I´m in need of two very simple scripts that I just cannot make them work in my quest.

 

1- If a given NPC is killed the quest goes to next stage

 

(????????????????) && (GetStage AAquest03 == 10)

setstage AAquest03 20

endif

 

2- In case a certain container is activated during a certain quest stage, something (some ashen remains) is removed from my inventory and quest goes to next stage

 

(?????????) && (GetStage AAquest03 == 40)

 

player.removeitem AAashenremains

setstage AAquest03 50

endif

 

What would be (???????) for 1 and 2?

 

NOTE: in case 2, it might be placing the item AAashenremains in this given container (AAmysticurn)

 

:confused:

In 1 you have several ways to do it. There is the myActorRef.GetDead function that you could use. It returns 1 if the actor is dead. Alternatively you could do a OnDeath block in a script for the actor. Now, what happens to your quest if the NPC dies before the player gets to AAquest03 stage 40? Would the player be stuck and unable to continue?

 

For 2, you could place your if getstage AAquest03 == 30 inside of the OnActivate block for the container AAmysticum. For instance

 

begin OnActivate

if getstage AAquest03 == 30

; do stuff here

player.removeitem AAashenremains

setstage AAquest03 50

endif

; do normal container opening now ( if player is allowed to open even if AAquest03 != 30)

activate

end

Link to comment
Share on other sites

Greetings.

 

I´m in need of two very simple scripts that I just cannot make them work in my quest.

 

1- If a given NPC is killed the quest goes to next stage

 

(????????????????) && (GetStage AAquest03 == 10)

setstage AAquest03 20

endif

 

2- In case a certain container is activated during a certain quest stage, something (some ashen remains) is removed from my inventory and quest goes to next stage

 

(?????????) && (GetStage AAquest03 == 40)

 

player.removeitem AAashenremains

setstage AAquest03 50

endif

 

What would be (???????) for 1 and 2?

 

NOTE: in case 2, it might be placing the item AAashenremains in this given container (AAmysticurn)

 

:confused:

In 1 you have several ways to do it. There is the myActorRef.GetDead function that you could use. It returns 1 if the actor is dead. Alternatively you could do a OnDeath block in a script for the actor. Now, what happens to your quest if the NPC dies before the player gets to AAquest03 stage 40? Would the player be stuck and unable to continue?

 

For 2, you could place your if getstage AAquest03 == 30 inside of the OnActivate block for the container AAmysticum. For instance

 

begin OnActivate

if getstage AAquest03 == 30

; do stuff here

player.removeitem AAashenremains

setstage AAquest03 50

endif

; do normal container opening now ( if player is allowed to open even if AAquest03 != 30)

activate

end

 

 

:biggrin:

 

Thanks a lot, I´ll try it!

 

Now, you showed me a problem: what am I supposed to add to the script in case the NPC gets dead before I reach this stage?

 

I would like something very simple, just to finish the quest automatically and warn th player that his task cannot be accomplished in case the NPC gets killed.

Link to comment
Share on other sites

Then it's something like this:

 

Begin OnDeath

If GetStage QuestID == ##
  SetStage QuestID ##2
ElseIf GetStage QuestID <= ##3
  SetStage QuestID ##4
EndIf

End

 

Replace ## with the stage of the quest where the player would be sent to kill the NPC. Replace ##2 with the "player has killed NPC" stage.

 

Replace ##3 with the stage just BEFORE the player gets the quest to kill said NPC (say the player must kill the NPC on Stage 5, then set ##3 to 4, since it will check for any stage that is less than or equal to 4)

 

Replace ##4 with the "player cannot kill this npc" stage, ending the quest.

 

 

 

Edit: However, depending on the type of NPC it is... you could just have the NPC disabled until the player reaches the quest stage to kill them, then enable the NPC. By "depending on it's type" I mean is it one that they'll interact with before they have to kill them, or will they even notice that suddenly this new NPC exists in the world? I've used that method a couple of times in my own quests to avoid either pre-quest killing, or just such a situation as the NPC dying before the player can get to that stage of the quest.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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