problem with syntax or not?

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
zippel
Posts: 123
Joined: Wed Feb 09, 2011 7:21 pm
Location: [RF] Krasnoyarsk
Contact:

problem with syntax or not?

Post by zippel »

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.

Code: Select all

InitialHtml = "1.htm"

Code: Select all

    def onFirstTalk (self,npc,player):        st = player.getQuestState(qn)        htmltext = "<html><head><body><center>Some text...</center></body></html>"        st.setState(State.STARTED)        return InitialHtml
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: problem with syntax or not?

Post by AntV »

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.
User avatar
zippel
Posts: 123
Joined: Wed Feb 09, 2011 7:21 pm
Location: [RF] Krasnoyarsk
Contact:

Re: problem with syntax or not?

Post by zippel »

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...
lion
L2j Veteran
L2j Veteran
Posts: 967
Joined: Sun Mar 11, 2007 7:49 pm
Location: Ukraine

Re: problem with syntax or not?

Post by lion »

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
User avatar
zippel
Posts: 123
Joined: Wed Feb 09, 2011 7:21 pm
Location: [RF] Krasnoyarsk
Contact:

Re: problem with syntax or not?

Post by zippel »

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
mda
:|
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: problem with syntax or not?

Post by jurchiks »

@AntV - setState does not affect onFirstTalk, it's called every time you click on the NPC, has nothing to do with quest states.

Code: Select all

    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.
User avatar
AntV
Posts: 177
Joined: Mon May 10, 2010 10:46 pm

Re: problem with syntax or not?

Post by AntV »

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 :)
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: problem with syntax or not?

Post by jurchiks »

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.
Post Reply