The scripts are doesn't work correctly after I replaced onTalk for onFirstTalk.
For example, this opens up only 1.htm
However, the further it takes no action, if you try to use it.
In logs no errors.
If you only want to use onFirstTalk, do not add a setState in there, otherwise the player will have a quest state next time he speaks, hence it won't call onFirstTalk, but onTalk.
AntV wrote:If you only want to use onFirstTalk, do not add a setState in there, otherwise the player will have a quest state next time he speaks, hence it won't call onFirstTalk, but onTalk.
What I must write, help me - I'm novice...
I'm removed this line (where st.setState(State.STARTED)) - and no effect...
look in other quest what use py, try test etc, not all time ask, you never learn smt if you all time would ask. I'm already give answer in other forum to you, and you don't want think
lion wrote:look in other quest what use py, try test etc, not all time ask, you never learn smt if you all time would ask. I'm already give answer in other forum to you, and you don't want think
def onFirstTalk(self,npc,player): return "<html><body><center>Some text...</center></body></html>" # or "1.htm", or InitialHtml
You don't need to set the state there as you do not use it. Don't just copy-paste other code, THINK what it does and if you even need it!
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste! Discussion breeds innovation.
jurchiks wrote:@AntV - setState does not affect onFirstTalk, it's called every time you click on the NPC, has nothing to do with quest states.
Really? Sorry then, my mistake, but I thought it is called on the first time you talk to the npc at the current state... I t seems I have to study the quests a bit more
There is no need to set the state in onFirstTalk unless you absolutely require a certain state, and this isn't the case.
And onFirstTalk is not linked in any way with quest states, it is simply called when you first talk to an NPC provided he's bound to this event (if I remember correctly, addFirstTalkId(npcId)).
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste! Discussion breeds innovation.