![]() |
Help crating a simple quest
Im trying to understand a bit of the ai code so I decided to make a small quest like the first one with keltirs and the world map. I would like to create the quest with the gremlins and the soulshots for novice as in official server. Please tell me a few tips how could I start. I suppose this is an ai-only related issue.
|
Keltir AI
Code:
class keltir : warrior_passiveThe wiseman's ai is too big because it has some other quests too included i suppose |
Grand Magister Gallint AI
Code:
class gallin : citizen |
Could you make yourself a bit more clear....
for example: if player has 10 keltir fangs and then talks to Gallint then they will get 1000 soulshots for novice or whatever.... |
hmm
most things are understandable for me... but could anyone please explain what the functions call_super and GetCurrentTick do? |
I want to create a small quest for begginers. They will firstly talk to gallint to take the quest, then collect the keltir fangs (quest item), and after that they will talk to him again to get the prize and complete the quest. The basic reason to do this is to learn how to make a simple quest :D
|
Quote:
Code:
handler 10 // MY_DYINGThis is only one of many method to make a simple quest (i obmited quest sound for simplify the code) Bye and good... xmas... |
youre my man :D thanks a lot! I owe you! If you have some time, give me some info about grand master's ai. How can he give the quest, so that the quest appears in Accepted Quests list, and how can I make a quest non repeatable? thanks again
|
Great guide, Can you exsplain this tho :
L90225 call_super Thanks, I am trying to learn AI too. |
the L90225 is just a branch...
you need em if you want to jump in the code ;) the call_super... not sure on it :? |
call_super
call (launch) the child part of the EventHandler like : Code:
class FirstOne : citizenSo imagine you have a gremlin, with AI = SecondOne When it do nothing... it search a target first (SecondOne class). if not found, it call the older handler, so if no target, ... it will walk (FirstOne class) because "SecondOne" AI inherit of "FirstOne" class I hope im clean. if you dont understand, i will post a real example |
I understand, basic consept of programming to save code, have all mobs inherit a few lines of code so that you can call the super and not have to copy and paste the same lines a few thousand times.
|
very useful information! I'm starting to understand AI code much more ^^
|
Excuse me. I can't find keltir fangs in items and in loot of keltirs. What number doest it have?
|
its not in the loot...
check keltirs ai class... you will find a my_dying handler and in this you will find the quest items it may drop ;) |
For making a quest a one time quest. You use the SetOneTimeQuest function in the ai, set to 0 for not completed, 1 for completed. You then use GetOneTimeQuest func to find out if they have completed it.
Also in order to do the quests the right way, you will have to add them into quest_pch and quest_pch2. quest_pch is simple just like item_pch [quest_name]<tab>quest_id quest_pch2 is just for items used in the quest. quest_id<space>number_of_items_used<space>then each item id. example: 262 1 707 262 is the quest id for fungus sac quest. 707 is the item id for the fungus sacs you collect. since 707 is the only item, 1 is the second number. If there was another item with id 708 it would look like this: 262 2 707 708 The item ids listed in quest_pch2 are the ones that get removed when you abort the quest. To make the quest display clientside you will have to add the quest to the questname-e.dat file in your system folder. In that file the quest_id is the id of the quest you used in quest_pch and quest_pch2. Then level is what step the specific entry is for. If theres 4 steps in your quest, questname-e.dat should have 4 different entries with the same quest ID. Each entry would have a level from 1 to 4. This is also where you add the description, and the item lists in quest accepted box. You can have it display a count for any item you want, even if they aren't included in quest_pch2. But only the ones in quest_pch2 will be deleted if you abort the quest. In the AI you will use the SetMemo and SetMemoState functions to start the quest, and to progress through the steps in the quest. None of this is proven, but it's what I have put together from playing with quests a bit. I'm currently working on writing a custom quest of my own, when I'm finished I can post more detailed instructions. |
Sorry for double post. Merge if you want.
Anyways, as promised heres a few snippets of sample AI and quest_pch stuff. This is for my new subclass quest and AI that I'm working on currently. quest_pch [path_to_subclass] 700 quest_pch2 700 2 19001 19006 I'm not posting clientside stuff, just look in your existing client files and follow the format. Easy enough. I don't have alot of AI to show, but you were asking how to make them show up in the accepted quests screen, here is how: shift_sp 1 push_event // talker push_const 32 add fetch_i // quest_last_reward_time push_const 644 add push_reg_sp fetch_i shift_sp 1 func_call 23 // func[GetCurrentTick] assign push_event // talker push_const 32 add fetch_i push_const 700 //THIS IS THE QUEST ID. func_call 60 // func[SetMemo] shift_sp -2 push_event // talker push_const 32 add fetch_i S90600. "ItemSound.quest_accept" push_string S90600 func_call 173 // func[SoundEffect] shift_sp -3 Place this in your quest_accepted handler and call it from an htm with <a action="bypass -h quest_accept?quest_id=700">Start Quest</a> You will still have to add in checks for if they have already started quest and such. And the progress of the quest with SetMemoState. Sorry it's not fully working, but I'm just starting to learn this stuff as well. Just posting what I get working to help others out if they are stuck at the same spots as I was. |
Nasc is alot easier to code quests in. Especially with questdata. o.o
|
Well, I don't know anything about NASC. I never got it to run properly so I gave up and just learned how to do things by hand. He asked for help so I offered what I knew.
|
Code:
class novice_helper : default_npc |
You have Else If's without any normal If, not sure if NASC has a problem with this but it might.
|
He's using the wrong handler for one. Menu_selected isn't what you want. You want talk_select... Second, yes that else if without a normal if is wrong too.
|
Well, I was going to mention the menu_selected thing instead of talk_selected, except it's not really "wrong."
It's doesn't follow how it's usually done, but quests can work just fine in menu_selected. I've coded them using ask reply sets before. |
| All times are GMT. The time now is 16:19. |