Jump to content

What's wrong with my script?


Luvian

Recommended Posts

Hi guys! I wasn't sure if I should post this in here or troubleshooting, but here goes.

 

I'm working on a script for a quest and I need it to give a different quest stage when talking to certain followers. I'm not too familiar so I'm not sure what I did wrong. Everything looks right to me.

 

This is in the "Result Script" of one of my topics. The quest is set to allow repeated stages and conversations.

 

Well here is the Result Script in question:

 

----------

 

if (GetIsID Charon == 1.0000)

setstage test123 10

elseif (GetIsID MQ08Fawkes == 1.0000)

setstage test123 10

elseif (GetIsID Jericho == 1.0000)

setstage test123 10

elseif (GetIsID Clover == 1.0000)

setstage test123 10

elseif (GetIsID StarPaladinCross == 1.0000)

setstage test123 10

elseif (GetIsID CG04Butch == 1.0000)

setstage test123 10

else

setstage test123 1

endif

 

----------

 

I want it to get set to stage 1 unless you talk to one of those npcs. It does get set to 10 when I talk to one of them, but it doesn't reset to 1 when I talk to someone else. Anyone know what could be the problem?

 

Thanks!

Link to comment
Share on other sites

What you need to do is drop the GetIsID and create new vars for each npc

 

short charonTalked

short butchTalked

and so forth.

 

During the dialog add the script results: set YourQuestId.charonTalked to 1

 

Then in your scripted

 

if ( charonTalked == 1 )

setstage YourQuestId 10

 

----------

 

The easiest thing for you though, is to drop all of that and just in the dialog that you have with each NPC, add the script result: setStage YourQuestId 10

Link to comment
Share on other sites

I think I get what you're saying. But the problem is that it's really one variable independent of which follower I talk to.

 

Basically I've got a fork. When you talk to any of these followers it set the quest to stage 10 which is common to all of them. When you talk to the quest NPC it set it to 1. That fork is repeatable so every times you say that line to one of the followers it set it to 10, to the NPC it set it to 1.

 

But my code doesn't get back to 1 when I talk to the NPC. It stays at 10. I don't understand why it's not working. Is it the "else"? What if I put a blank "else if" instead?

Link to comment
Share on other sites

create 1 variable.

 

short whoPlayerTalkedTo

 

any time the player talked to a follower, have the dialog script result: set whoPlayerTalkedTo to 1

any time the player talked to an npc, have the dialog script result: set whoPlayerTalkedTo to 2

 

Then:

if ( whoPlayerTalkedTo != 0 )
if ( whoPlayerTalkedTo == 1 )
	setStage QuestID 1
elsif ( whoPlayerTalkedTo == 2 )
	setStage QuestID 10
endif
endif

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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