Problem with new NPC Script

Khelendil
Posts: 21
Joined: Sun Nov 04, 2012 10:56 pm

Problem with new NPC Script

Post by Khelendil » Thu Dec 20, 2012 9:42 am

Hi Guys.

First of good job on keeping the project up and running. And now to the topic, I ran into some trouble running a certian cs.
The NPC Faursel in LowerJeuno which is for the quest "the road to aht urhgan" wont return the controls bk to the player after his second cs. After a little research on that I found out that he wasnt talking completely but dropping his last 2 sentences which in turn breaks the game as u can still write text but are trapped inside the cs. Question is now could someone check that this is not just me? The CSID is 0x274f and he drops after he talked about the Pso'Xja Chips. Same happens on 0x2750 too.

Sidenote: I know that ToAU is still off the scope for implementation but I thought that if we wanna implement the Job Quests for PUP/BLU/COR we need to have access to the neccesairy areas. So my plan was to finish the "Lure of the Wildcat" Quest Series and this one quest. Eventually even adding the Missions 1+ (til like 13) for ppl to get Mercenairy Rank1

ik2012
Posts: 53
Joined: Fri Nov 16, 2012 2:03 pm

Re: Problem with new NPC Script

Post by ik2012 » Thu Dec 20, 2012 11:26 am

Confirmed. I chose the easy list and he stopped talking as soon as a list was chosen. It could be simply that he doesn't know what items to call out. I have noticed on other cs that if they mention items then they need to be told what those are. This one could be tricky with a bunch of different items and a player choice involved too. But for all I know it is a straight up bug. Might want to consider putting it on the bug tracker just in case.

Racsr
Posts: 10
Joined: Thu Dec 20, 2012 12:15 pm

Re: Problem with new NPC Script

Post by Racsr » Thu Dec 20, 2012 12:29 pm

Here's what your looking for,

Code: Select all

function onEventUpdate(player,csid,option)

	if (csid == 0x274F or csid == 0x2750) then
		if (option == 10) then     -- Beginner List
			player:updateEvent(537,538,539,540,541,542,0,0);
		elseif (option == 12) then -- Intermediate List
			player:updateEvent(1532,1533,1535,0,0,0,0,0);
		elseif (option == 13) then -- Advanced List
			player:updateEvent(1692,1693,1694,0,0,0,0,0);
		elseif (option == 14) then -- Gil Option
			player:updateEvent(1,1,1,1,1,1,player:getGil(),1);
		elseif (option == 2 or option == 1073741824) then  -- Let me think about it... / Cancel
			
		end
	end

end;
Here's the complete "The Road to Aht Urhgan" quest for the current SVN. :)

EDIT: I missed a required variable in my patch. Uploaded the corrected file...
Attachments
The_Road_to_Aht_Urhgan-public2114_v2.patch
Fixed missing variable.
(7.55 KiB) Downloaded 200 times
Last edited by Racsr on Thu Dec 20, 2012 1:10 pm, edited 1 time in total.

ik2012
Posts: 53
Joined: Fri Nov 16, 2012 2:03 pm

Re: Problem with new NPC Script

Post by ik2012 » Thu Dec 20, 2012 1:04 pm

/slowclap

Nice work there.

Khelendil
Posts: 21
Joined: Sun Nov 04, 2012 10:56 pm

Re: Problem with new NPC Script

Post by Khelendil » Thu Dec 20, 2012 3:30 pm

ok thx for clearing up my worries and finishing that project. ill stick to the lure of the wildcat quests on my side as windy is almost rdy here.
Is there some kinda overview off all available Lua objects n the members within them? would be nice to have for future projects cuz its kinda time consuming running through the c++ bindings and lua exports to find all the needed stuff each file a time.

Racsr
Posts: 10
Joined: Thu Dec 20, 2012 12:15 pm

Re: Problem with new NPC Script

Post by Racsr » Thu Dec 20, 2012 3:53 pm

Awesome! Can't wait to have those quests available, thanks for your work. ^^ As far as I know there is not a listing of 'all available Lua objects'. As you've said the best way to locate methods for anything is reviewing the core, lua_baseentity.cpp or poking around other scripts... scripts/zones/RuLude_Gardens/Maat.lua gives great examples of several methods.

Other than that, the best thing we've got available right now is the scripting basics page on the wiki: http://kile.dyndns.info:8765/index.php? ... ke_a_Quest :)

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Problem with new NPC Script

Post by bluekirby0 » Thu Dec 20, 2012 3:54 pm

It is something you get used to...usually if I want to figure out how to do something I look for an existing script that does something similar and copy bits of it. I started an "advanced" scripting guide on the wiki with a breakdown of a lot of less commonly used functions a long time ago but never got around to finishing it.

ik2012
Posts: 53
Joined: Fri Nov 16, 2012 2:03 pm

Re: Problem with new NPC Script

Post by ik2012 » Thu Dec 20, 2012 5:29 pm

I for one would love to have an advanced section. I considered writing it myself once I got through a few more quests (successfully... lol) but if you have it roughed out I could polish it up for you kirby and get it posted. Do you still have the text available?

bluekirby0
Developer
Posts: 707
Joined: Sun Jul 22, 2012 12:11 am

Re: Problem with new NPC Script

Post by bluekirby0 » Thu Dec 20, 2012 5:42 pm

It's been on the wiki for a while but I haven't linked any pages to it yet. You can find it at: http://kile.dyndns.info:8765/index.php? ... _Scripting

ik2012
Posts: 53
Joined: Fri Nov 16, 2012 2:03 pm

Re: Problem with new NPC Script

Post by ik2012 » Thu Dec 20, 2012 5:56 pm

Beautiful!

Post Reply