EOSERV Forum > EOSERV > Need help with quest script limitation: TalkedToNpc()
Page: << 1 >>
Need help with quest script limitation: TalkedToNpc()
Author Message
Post #202419 Need help with quest script limitation: TalkedToNpc()

Hello, I want to start my "custom" quests at a high quest ID number such as 500, so that we have room to add any third party quests, that would otherwise conflict or override quests that are in the lower range NPC Quest ID numbers.


Some of the scripting functions work at a high quest ID, but the most notable one that doesn't work, is the following method:

[code]

TalkedToNpc(ID)

[/code]

That method only accepts a parameter type of "unsigned char". Which ranges from -128 to 127. That means any ID over 127 breaks the code.


If you look at the C++ source code for EOServ, you can find that the parameter is definitely "unsigned char".

[code]

bool Quest_Context::TalkedNPC(char vendor_id)

[/code]


I tested this and can confirm this is the problem.


I understand the problem, but I can't think of any good solution to get around this (since EOSource comes pre-compiled). Is there any suggestions to where we can have more then a max of 127 FULLY WORKING quests.  I know we could technically have more then 127 quests loaded, but if some methods require a "char", then we are soft capped at 127.


Also, I am new to EO quest scripting and noticed that some quests use more then one NPC Quest ID. Can someone explain why is that? And why it would work? I tried using an NPC Quest ID that's different then the file ID and it didn't work.


Here's an example of a script that uses multiple NPC Quest IDs:

[Code]

Main

{

questname "Pjedro's Son"

version 2

}


state Begin

{

desc "Talk to Pjedro"

action AddNpcText( 1 , "Hi, i never seen you before, let me introduce myself. I am pjedro, i used to be a famous farmer known from Aeven to Anundo.." );

action AddNpcText( 1 , "Now my days are sad, and empty. Do you want to hear more of my story?" );

action AddNpcInput( 1 , 1 , "Yes please tell me");

action AddNpcInput( 1 , 2 , "No time, sorry!");


rule InputNpc( 1 ) goto Learn1

rule InputNpc( 2 ) goto GoReset

}


state Learn1

{

desc "Talk to Pjedro's Wife"

action ShowHint("Quest reward: 12600 EXP")

action AddNpcText( 1 , "My son, i lost our son.. i should had listened to my wife." );

action AddNpcText( 3 , "Yes our son is missing, but how.. how do you know about our son?");


action AddNpcInput( 3 , 1 , "Pjedro told me");

action AddNpcInput( 3 , 2 , "Never mind");


rule InputNpc( 1 ) goto Learn2

rule InputNpc( 2 ) goto GoReset

}


//... Skipped code for clarity reasons


state TalkAunt

{

desc "Talk to Nena, stronghold"


action AddNpcText( 9 , "I am so worried about Pjedro's son.. He never made it here, something terrible must have happened. ");

action AddNpcText( 9 , "I never been outside this stronghold for years, I hope nothing bad happened.");


action AddNpcInput( 9 , 1 , "No worries, i will find him");

action AddNpcInput( 9 , 2 , "Oh, the carnivos ate him");


rule InputNpc( 1 ) goto FindWitness

rule InputNpc( 2 ) goto FindWitness2

}


//... Skipped code for clarity reasons


state TalkGuard

{

desc "Talk to swamp guard"


action AddNpcText( 10 , "You looking for a little kid carrying some vegtables. Yes i recall seeing a little kid walking here..");

action AddNpcText( 10 , "But im affraid i cannot tell you more, we are not allowed to talk to civilians, Imperial rules you know..");

action AddNpcText( 10 , "Please go see our captain. He is guarding Aeven's south entrance against the invading sheeps *chuckling*");


rule TalkedToNpc(10) goto GetPermission

}


//... Skipped code for clarity reasons


state TalkCaptain

{

desc "Speak captain, south Aeven"


action AddNpcText( 34 , "So you are looking for a little kid that got lost on the way to the Stronghold? You are truely noble..");

action AddNpcText( 34 , "Yes, ofcourse you have my permission.. I cannot believe he did not tell you right away, good guards are hard to find these days *sighs*");


rule TalkedToNpc(34) goto TalkGuard2

}


//... Skipped code for clarity reasons

[/code]


Notice the above script uses NPC Quest IDs: 1, 3, 9, 10, 34, and more (that I didnt show). Should this script work with multiple IDs. If so, why? Desclaimer: I haven't tried the above quest.


Thank you for your time!


---
Just your friendly neighborhood Programmer-Man!
7 years, 12 weeks ago
Post #202420 Re: Need help with quest script limitation: TalkedToNpc()

That quest has multiple NPCs you have to talk to.

I.E. QID 1 = Pjedro,
QID 3 = Pjedro's wife
QID 9 = Nena

etc.

7 years, 12 weeks ago
Post #202421 Re: Need help with quest script limitation: TalkedToNpc()
Soook posted: (8th Feb 2017, 08:55 am)

That quest has multiple NPCs you have to talk to.

I.E. QID 1 = Pjedro,
QID 3 = Pjedro's wife
QID 9 = Nena

etc.


Thank you. I think I understand.

I solved my original issue by simply changing the source code and making the parameter an "int" instead of a "char".

---
Just your friendly neighborhood Programmer-Man!
7 years, 12 weeks ago
Post #202455 Re: Need help with quest script limitation: TalkedToNpc()

Can confirm this is a mistake. Correct parameter type was supposed to be short, not char.

Added a bug report.

7 years, 11 weeks ago
Page: << 1 >>

EOSERV Forum > EOSERV > Need help with quest script limitation: TalkedToNpc()