Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 18.01.2006, 07:23   #51
TheOrder
Архивный участник
 
Join Date: Sep 2005
Posts: 731
Default

Tnx for the AI functions kvoxi , realy helpfull !!!
TheOrder is offline  
Old 18.01.2006, 08:57   #52
toolpunk
Архивный участник
 
Join Date: May 2005
Posts: 2,033
Default

very nice info again...
however static left us some time ago...
he visits the forum once in a while but doesnt post anymore
toolpunk is offline  
Old 19.01.2006, 02:24   #53
2Rain
Архивный участник
 
Join Date: Aug 2005
Posts: 194
Default

push_const 1003
func_call 65 // func[GetOneTimeQuestFlag]

This is string for 1-time quest.
How make 2-time quest (not multi)?

PS: I see... Need make dual checking in each for 1-time quest. If first checking returns (quest complete)? than go to checking2.

So, if ch1 & ch2 not conmleted - may jump to run quest.
If ch1 completed - jump ch2. If ch2 not completed - may jump to run quest.
If ch1 & ch2 are completed - jump ti "Go to asshole, dude!" :lol:

Special thanks to kvoxi for представленную инфу. :wink:

PPS: I think, in this case must found 2 different Quest ID.
2Rain is offline  
Old 19.01.2006, 19:01   #54
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Quote:
Originally Posted by 2Rain
PPS: I think, in this case must found 2 different Quest ID.
I think too
But, i have some idea. I need a check. I will post results later
kvoxi is offline  
Old 20.01.2006, 16:11   #55
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Quote:
Originally Posted by kvoxi
But, i have some idea. I need a check. I will post results later
i got this results:
SetOneTimeQuestFlag(creature, quest_id, flag)
flag=GetOneTimeQuestFlag(creature, quest_id)
flag=[0,1]

There is QuestFlag_bitmask.
How it works (C-like language):

SetOneTimeQuestFlag():
flag<>0: creature.QuestFlag_bitmask |= 1 << quest_id;
flag==0: creature.QuestFlag_bitmask &= ~(1 << quest_id);

GetOneTimeQuestFlag():
(creature.QuestFlag_bitmask & 1 << quest_id) ? 1:0;

If quest_id <0 or quest_id > 255, then u get error.
ONLY quests with ID>=0 && ID<=255 can have a OneTimeQuestFlag
Conclusion: Set|GetOneTimeQuestFlag() functions is not usefull for making 2-time quest.

Try to use SetMemoState|GetMemoState functions.
good luck
kvoxi is offline  
Old 20.01.2006, 19:35   #56
SlayerX
Архивный участник
 
Join Date: Dec 2005
Posts: 82
Default

very nice :P
SlayerX is offline  
Old 25.01.2006, 12:40   #57
RmzVoid
Архивный участник
 
Join Date: Apr 2005
Posts: 357
Default wtf

class citizen
{
EventHandler TALKED(talker)
{
ShowPage(talker,"sm_hi.htm");
}
}

class sample : citizen
{
handler:
EventHandler TALK_SELECTED(talker)
{
if ( _from_choice == 0 )
{
//Do something
}
if ( _from_choice == 1 )
{
//Do something 2
}
}

EventHandler MENU_SELECTED(talker, ask ,reply)
{
if(ask == 2)
{
if ( reply == 33 )
{
AddChoice(2,"choice 0 2");
AddChoice(3,"choice 0 2");
ShowChoicePage(talker,0);
}
if ( reply == 34 )
{
AddChoice(6,"choice 1 6");
AddChoice(7,"choice 1 7");
ShowChoicePage(talker,1);
}
}
}

When I select reply 34, I see list of choices and then press on one choice I enter in TALK_SELECTED handler and normally exec "if ( _from_choice == 1 ){..}" block. But if I select reply 33 I also see appropriate choices, but not enter to TALK_SELECTED handler then i select one of choice, I just see sm_hi.htm page again. Can anybody help me? How use ShowChoicePage func?
RmzVoid is offline  
Old 25.01.2006, 21:28   #58
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default Re: wtf

Quote:
Originally Posted by RmzVoid
Can anybody help me? How use ShowChoicePage func?
IMHO:
ShowChoicePage(crature, from_choice);
The call ShowChoicePage(talker,0) set _from_choice to 0;
kvoxi is offline  
Old 26.01.2006, 00:26   #59
RmzVoid
Архивный участник
 
Join Date: Apr 2005
Posts: 357
Default

My post explains thet is not.
ShowChoicePage (talker,2) also not works. I mean if ( _from_choce == 2 ) { ... }
RmzVoid is offline  
Old 26.01.2006, 07:10   #60
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Quote:
Originally Posted by RmzVoid
My post explains thet is not.
ShowChoicePage (talker,2) also not works. I mean if ( _from_choce == 2 ) { ... }
ShowChoicePage(talker, option)
What is "option" - i dont know
All choices must be processed by TALK_SELECTED handler in <if(_from_choice==1) {...}> branch

PS:
func ShowChoicePage pass the user HTML like:
<HTML><BODY>
<a action="bypass -h quest_choice?choice="<Choice_1>"&option="<Option>" >["<Choice_1 string>"]</a>
...
<a action="bypass -h quest_choice?choice="<Choice_N>"&option="<Option>" >["<Choice_N string>"]</a>

</BODY></HTML>
kvoxi is offline  
Old 26.01.2006, 09:10   #61
RmzVoid
Архивный участник
 
Join Date: Apr 2005
Posts: 357
Default

so maybe use choice & option variables?
Or you mean
<a action="bypass -h quest_choice?_from_choice=2&_code=3">["<Choice_1 string>"]</a>
?
RmzVoid is offline  
Old 26.01.2006, 10:18   #62
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Quote:
Originally Posted by RmzVoid
so maybe use choice & option variables?
Or you mean
<a action="bypass -h quest_choice?_from_choice=2&_code=3">["<Choice_1 string>"]</a>
?
I mean
<a action="bypass -h quest_choice?choice="<Choice_1>"&option="<Option>" >["<Choice_1 string>"]</a>
and NOTHING ELSE!!!
Where u see "quest_choice?_from_choice=..." ???
no more comments...
PS:
in AI u mau use:
_from_choice (=1 if TALK_SELECTED handler process "bypass -h quest_choice" user request)
_code (=choice from HTML)
kvoxi is offline  
Old 26.01.2006, 11:25   #63
RmzVoid
Архивный участник
 
Join Date: Apr 2005
Posts: 357
Default

and what is it "_code" in your case?

Квохи ты че тупишь!
choice - нет такой переменной в АИ.обж
есть _from_choice _code и _ChoiceN

проведи аналогию
MENU_SELECTED ask,reply
action="menu_select?ask=2&reply=3"
это как в ПХП, далее будут использоваться ask и reply (в скрипте)
RmzVoid is offline  
Old 29.01.2006, 18:05   #64
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Quote:
Originally Posted by kvoxi
ShowChoicePage(talker, option)
What is "option" - i dont know
Correction (not tested):
if OPTION=0, then l2npc.exe generate TALKED event with followed initialized variables:
myself;
talker;
_from_choice=1;
_code;
if OPTION<>0, then l2npc.exe generate TALK_SELECTED event with followed initialized variables:
myself;
talker;
_from_choice=1;
_code;
PS
и еще обязательно надо рассказать "тупым" людям, чтоб положили на RFC HTTP протокола и сделали на веб-серверах обработку передаваемых из хтмл-форм данных методами POST, GET не так как есть в спецификации, а "как в ПХП"
kvoxi is offline  
Old 30.01.2006, 00:34   #65
RmzVoid
Архивный участник
 
Join Date: Apr 2005
Posts: 357
Default I make by another way

class sample : citizen
{
handler:
EventHandler CREATED()
{
myself.i_ai0=0;
}

EventHandler TALK_SELECTED(talker)
{
if ( _from_choice!=0 && myself.i_ai0==1 )
{
//Do something
myself.i_ai0 = 0;
}
if ( _from_choice!=0 && myself.i_ai0==2 )
{
//Do something 2
myself.i_ai0 = 0;
}
}

EventHandler MENU_SELECTED(talker, ask ,reply)
{
if(ask == 2)
{
if ( reply == 33 )
{
AddChoice(2,"choice 0 2");
AddChoice(3,"choice 0 2");
myself.i_ai0 = 1;
ShowChoicePage(talker,1);

}
if ( reply == 34 )
{
AddChoice(6,"choice 1 6");
AddChoice(7,"choice 1 7");
myself.i_ai0 = 2;
ShowChoicePage(talker,1);
}
}
}
RmzVoid is offline  
Old 30.01.2006, 03:16   #66
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

EventHandler TALK_SELECTED(talker)
{
if ( _from_choice!=0 && (_code==2 || _code==3) ) {
//Do something
}
if ( _from_choice!=0 && (_code==6 || _code==7) ) {
//Do something 2
}
}
kvoxi is offline  
Old 30.01.2006, 11:31   #67
kvoxi
Архивный участник
 
Join Date: Oct 2005
Posts: 102
Default

Quote:
Originally Posted by kvoxi
Quote:
Originally Posted by kvoxi
ShowChoicePage(talker, option)
What is "option" - i dont know
Correction (not tested):
if OPTION=0, then l2npc.exe generate TALKED event with followed initialized variables:
myself; talker; _from_choice=1; _code;
if OPTION<>0, then l2npc.exe generate TALK_SELECTED event with followed initialized variables:
myself; talker; _from_choice=1; _code;
tested - worked:
[php:1:d1d73b739f]
EventHandler TALKED (talker,_from_choice,_code)
{
if (_from_choice==0) {
AddChoice(11, "Choice_11");
AddChoice(12, "Choice_12");
AddChoice(13, "Choice_13");
AddChoice(14, "Choice_14");
ShowChoicePage(talker,0);
}
if (_from_choice!=0) {
SayInt(_code);
AddChoice(21, "TALKED: Choice_21");
AddChoice(22, "TALKED: Choice_22");
AddChoice(23, "TALKED: Choice_23");
AddChoice(24, "TALKED: Choice_24");
ShowChoicePage(talker,1);
}
}

EventHandler TALK_SELECTED (talker, _from_choice, _code)
{
if (_from_choice!=0) {
SayInt(_code);
AddChoice(31, "TALK_SELECTED: Choice_31");
AddChoice(32, "TALK_SELECTED: Choice_32");
AddChoice(33, "TALK_SELECTED: Choice_33");
AddChoice(34, "TALK_SELECTED: Choice_34");
ShowChoicePage(talker,1);
}
}
[/php:1:d1d73b739f]
kvoxi is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 17:14.