![]() |
|
|
#1 |
|
Архивный участник
Join Date: Feb 2005
Posts: 766
|
Im trying to do a simple NPC that when a player clicks on a
Code:
<a action="bypass -h talk_select">Link</a> Code:
L####1 push_event // talker push_const 32 add fetch_i // level push_const 888 add fetch_i push_const 30 greater_equal branch_false L####2 L####2 shift_sp 1 push_event // talker push_const 32 add fetch_i S###1. "IS_LVL_30.htm" push_string S###1 func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 jump L##### L###4 shift_sp 1 push_event // talker push_const 32 add fetch_i S###2. "IS_NOT_LVL_30.htm" push_string S###2 func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Jun 2005
Posts: 143
|
I have a similar question about the AI.obj
when we do Code:
push_event // talker push_const 32 add |
|
|
|
|
#3 |
|
Архивный участник
Join Date: Apr 2005
Posts: 314
|
Pointer to talker structure afaik.
|
|
|
|
|
#4 | |
|
Архивный участник
Join Date: Aug 2005
Posts: 1,531
|
Quote:
So, use cast skills to players (in defined levels range) to finished talking.
|
|
|
|
|
|
#5 |
|
Архивный участник
Join Date: Feb 2005
Posts: 766
|
Well thats exactly what im trying to do. The C3 newbie buffer, but the others npcs with quests have alot of other code (to check if its a one time quest and stuff) that confuses me alot. Im new to this AI.obj stuff and still dont get most of it.
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Feb 2005
Posts: 766
|
Well no one knows how to do this? Ive seen ppl do much harder stuff common im pretty sure this is an easy thing. Give this man some help
|
|
|
|
|
#7 |
|
Архивный участник
Join Date: Mar 2005
Posts: 1,143
|
I agree. If we can get the breakdown of AI.obj and how it works (with a sticky as well when we get it), it would help immensely. :wink:
|
|
|
|
|
#8 |
|
Архивный участник
Join Date: May 2005
Posts: 979
|
hmm do u know how to check item attribute via ai.obj? I have some code for mymyu that can change hatch to strider.. but it totally lag server when u run that (player click on that html menu)
|
|
|
|
|
#9 |
|
Архивный участник
Join Date: Feb 2005
Posts: 766
|
You must have done it wrong then (maybe u inserted the code in the wrong place). I have the same code but it doesnt lag at all.
(still awating for somenoe to awnser my question) |
|
|
|
|
#10 |
|
Архивный участник
Join Date: Jun 2005
Posts: 374
|
Hmm, let me try to make a 'newbie guide' for ai. :P In the AI all the 'pieces' are linked. I.e, you make a new merchant, that you call Gon.
It'll be like class gon : merchant class_end What happens here is, you define a new class called 'gon' and you load all the 'merchant'-class ai aswell. If you look in the ai.obj and you look for 'merchant :', you'll see what all the merchant AI is. Overall, for a thing like a level-check, 'citizen' will be appropiate. ![]() Let's keep the idea of Gon, but make it a citizen that checks your level: class gon : citizen Every part has handlers. All the handlers are written down somewhere, you can find it with the search. There are handlers for being attacked, being talked to, or being asked. In this case we work with talk select. This is handler 4. Let's start: handler 4 // TALK_SELECTED variable_begin "fhtml0" "i0" "quest_id" "talker" "myself" "_choiceN" "_code" "_from_choice" variable_end If you search through the ai.obj, you'll see that talk_select things always start with a check if it's from choice. So: push_event // _from_choice push_const 332 add fetch_i push_const 0 equal branch_false L1 Ok, the first part is ready. If it's not from choise there shouldn't be done anything. L1 will be at the bottom, so nothing gets loaded anymore. Let's continue with your part L2 push_event // talker push_const 32 add fetch_i // level push_const 888 add fetch_i push_const 30 greater_equal branch_flase L4 Ok, what we have above is fairly simple. The player is push_const 32. With the fetch_i push_const 888 command you get his level. This should be greater, or equal, to the value '30'. If it's not, then you should go to L4, otherwise continue. L3 shift_sp 1 push_event // talker push_const 32 add fetch_i S1. "IS_LVL_30.htm" push_string S1 func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 jump L1 Ok, obvious. It should show the page and after this it shouldn't parse any more code. The L1 is the empty label at the end. Ok, if we're >= 30, you get a page and the rest isn't parsed. So, if you're < 30, the ai should have a code to show you a page. So: L4 shift_sp 1 push_event // talker push_const 32 add fetch_i S2. "IS_NOT_LVL_30.htm" push_string S2 func_call 43 // func[ShowPage] shift_sp -2 shift_sp -1 L1 handler_end class_end |
|
|
|
|
#11 |
|
Архивный участник
Join Date: Feb 2005
Posts: 766
|
Finaly my pleas where heard. xD your help is very very much apreciated, and im sure alot more ppl other then me will apreciate this
![]() My code was pretty correct afterall, i just switched the htmls pages (and now that i look at it i dunno why i made that mistake couse i did understood the branch_false , probably wasnt paying attention. But your guide allowed me to understand the rest i was missing. Again many thanks
|
|
|
|
|
#12 | |
|
Архивный участник
Join Date: May 2005
Posts: 2,033
|
woot!
thats nice. really helpful. mods plz sticky this sumwhere! thx a lot aikeleer. u r the man ![]() and now a lil quest for u my young apprentices XD lol im talkin trash... find the mistake. Quote:
|
|
|
|
|
|
#13 |
|
Архивный участник
Join Date: Mar 2005
Posts: 1,143
|
Awesome!
![]() I'll make a note of this topic so I can put it in a sticky forum. Now all I have to do is sift through all of the [Tutorial] topics and move them into one place. Thanks a bunch, Aikeleer! :thumbup: |
|
|
|
|
#14 | |
|
Архивный участник
Join Date: Sep 2005
Posts: 7
|
Unfortunately I've posted my request in wrong topic. Hope to find answer in this one. That's why I'll "copy/paste" my question here. =)
Quote:
|
|
|
|
|
|
#15 |
|
Архивный участник
Join Date: Mar 2005
Posts: 1,143
|
Yeah, it's called NASC. I'm sure it's here on the forum. Only problem is that it only supports C1 and it's really old and obsolete I believe.
|
|
|
|
|
#16 |
|
Архивный участник
Join Date: May 2005
Posts: 2,033
|
afaik its a compiler.
means u enter source code. more logic than this pseudo assembler crap and compile it 2 get the pseudo asm crap. kinda easier, better, faster and more efficient. i think it worx on sina only... or was it meifu? |
|
|
|
|
#17 |
|
Архивный участник
Join Date: Sep 2005
Posts: 7
|
That's exactly the thing I need for my Sina C1. The problem is I couldn't find it neither on this forum nor somewhere else. Can somebody post the link?
|
|
|
|
|
#18 |
|
Архивный участник
Join Date: Mar 2005
Posts: 1,143
|
|
|
|
|
|
#19 |
|
Архивный участник
Join Date: May 2005
Posts: 2,033
|
so does it still work in c3?
i mean basically the structure of ai n scripts r still the same as back in c1. only heavily modified files r the exes... [off-topic] woot! sum1 is usin the hosts i posted. ![]() im kinda happy now rofl^^ [/off-topic] |
|
|
|
|
#20 |
|
Архивный участник
Join Date: Sep 2005
Posts: 7
|
There I've found "AIEditor.zip". But I've already had that crap. Just wanted to try NASC.
P.S. Thanks any way. ;-) |
|
|
|
|
#21 |
|
Архивный участник
Join Date: Jul 2005
Posts: 50
|
I have been trying to get NASC to work for some time as well. I am trying to add a very simple kill monsters and collect items quest, but it seems far too difficult to do just in AI.OBJ. The way everything is organized and numbered in there is confusing as hell.
Unfortunately, it seems that the version of NASC that we have is not compatible with the servers that we have. Our NASC version produces an AI.OBJ with the following version information before crashing with a syntax error: SharedFactoryVersion 294 NPCHVersion 177 NASCVersion 105 NPCEventHVersion 76 Debug 0 Whereas our working AI.OBJ has the following version information: SharedFactoryVersion 324 NPCHVersion 210 NASCVersion 133 NPCEventHVersion 82 Debug 0 Unless we can find NASC version 133, it appears we won't be able to modify the AI.OBJ any easier than we currently are.... which really sucks, because I doubt I will be able to figure it out enough to add the quests I was hoping to add. - Anubisan |
|
|
|
|