Page 1 of 1

Deserted well - npc

Posted: 08 Sep 2008, 18:30
by 5t3v3
I planned this NPC when I mapped the snakepit, basically you can click the well in the eastern desert and jump down it to go into the pit. Never got made though, so I thought I'd look into scripting NPC myself. This looks right, right?

Code: Select all

}

new_7-1.gat,119,70,0	script	empty	128,{

	mes "[Deserted well]";

	mes "You hear strange noises.";
	
	mes "Do you want to jump in?";

	next;

	menu

	"Yeah no risk, no glory!",yes,

	"Are you out of your mind?",no;

yes:

	warp "new_22-1.gat",81,76;
	
	close;

no:

	close;

}

Re: Deserted well - npc

Posted: 08 Sep 2008, 19:19
by Crush
We usually start all jump labels with "L_" and thoughts of the player character are indicated by brackets to separate them from verbal speech, but syntactically it should be correct. I didn't test it, though.

Re: Deserted well - npc

Posted: 08 Sep 2008, 19:44
by 5t3v3
You mean like this?

Code: Select all

new_7-1.gat,119,70,0	script	empty	127,{

	mes "[Deserted well]";

	mes "(You hear strange noises.)";
	
	mes "(Do you want to jump in?)";

	next;

	menu

	"(Yeah no risk, no glory!)",L_yes,

	"(Are you out of your mind?)",L_no;

L_yes:

	warp "new_22-1.gat",81,76;
	
	close;

L_no:

	close;

}
(oh also corrected the number of the map)

Re: Deserted well - npc

Posted: 08 Sep 2008, 19:48
by Jaxad0127
The brace at the top is bad. The NPC ID should be -1 so it doesn't have a graphic. Not sure on the name....

Re: Deserted well - npc

Posted: 08 Sep 2008, 20:04
by Crush
jaxad0127 wrote:The NPC ID should be -1 so it doesn't have a graphic.
Are you sure that this works? I normally use 127 for invisible NPCs (intentionally left blank spot in npcs.png).

Re: Deserted well - npc

Posted: 08 Sep 2008, 20:15
by Jaxad0127
The scripts that gives monster points use it. I'll test later.

Re: Deserted well - npc

Posted: 08 Sep 2008, 20:51
by 5t3v3
Well, the npcs.xml says:

Code: Select all

 <npc id="127"><sprite variant="27">npc.xml</sprite></npc><!-- Guy with black clothes and axe -->
 <npc id="128"><sprite variant="28">npc.xml</sprite></npc><!-- empty (Invisible NPC) -->
Not quite sure why you want me to notice in the script for monster points...

Here's a script for a well in a different map (near the mines) that allows you to fill empty bottles:

Code: Select all

new_1-1.gat,26,98,0	script	empty	128,{
	if(countitem(540) == 0)goto L_nohave;
	mes "[Well]";
	mes "(Do you want to fill an empty bottle?)";
	next;
	menu
	"(That's what I'm here for.)",L_yes,
	"(No, I need them.)",L_nohave;

L_yes:
	mes "[Well]";
	mes "(You've got a bottle of water.)";
	delitem 540,1;
	getitem 541,1;
	close;

L_nohave:
	mes "(Do you want to drink from the well?)";
	next;
	menu
	"(Sure, why not.)",L_drink,
	"(No, I'm fine)",L_nodrink;

L_drink:
	mes "[Well]";
	mes "(The bucket is leaking; it's empty by the time you've pulled it up...)";
	close;

L_nodrink:
	close;

}

Re: Deserted well - npc

Posted: 08 Sep 2008, 21:44
by Crush
You should update your data files. The current version on SVN has ID 127 for the empty graphic:

Code: Select all

 <npc id="126"><sprite variant="26">npc.xml</sprite></npc><!-- Guy with black clothes and axe -->
 <npc id="127"><sprite variant="27">npc.xml</sprite></npc><!-- empty (Invisible NPC) -->
 <npc id="128"><sprite variant="28">npc.xml</sprite></npc><!-- Nomad, standing -->
You can see the file here: http://themanaworld.svn.sourceforge.net ... xt%2Fplain

You could have catched this error yourself when you would have tested your script before posting it. I would recommend you to set up a local server yourself to test NPC scripts before you publish them.


The bottle refill script is not a good idea because the latest version of the server script files gives you an empty bottle whenever you use a bottle of water. With a possibility for free refills players would have infinite healing items for free.

Re: Deserted well - npc

Posted: 08 Sep 2008, 22:29
by 5t3v3
How about there's a random chance your bottle falls out of the bucket and you lose it? That way, if there is an alternative use for the bottles, people might not use it that much. I took rand(5) just to get an idea, but different chances are of course an option. Also this time, they have to try to drink first before they have the option to fill a bottle, that way it's more annoying to fill huge amounts of bottles.

Code: Select all

new_1-1.gat,26,98,0   script   empty   127,{
   mes "[Well]";
   mes "(Do you want to drink from the well?)";
   next;
   menu
   "(That's what I'm here for.)",L_drink,
   "(No, I'm fine)",L_no;

L_drink:
   mes "[Well]";
   mes "(The bucket is leaking; it's empty by the time you've pulled it up...)";
   if(countitem(540) >= 1)goto L_bottle;
   close;

L_bottle:
   mes "[Well]";
   mes "(Do you want to place an empty bottle into the bucket to fill it?)";
   next;
   menu
   "(That's the best Idea I've heard all day.)",L_yes,
   "(No, I need it for something else.)",L_no;

L_yes:
   delitem 540,1;
   set @Temp1,rand(5);
   if (@Temp1 == 0) goto L_succes;
   mes "(Your bottle fell out of the bucket.)";
   close;

L_no:
   close;

L_succes:
   getitem 541,1;
   mes "[Well]";
   mes "(You've got a bottle of water.)";
   close;

}

Re: Deserted well - npc

Posted: 09 Sep 2008, 00:29
by Jaxad0127
It'd be better if they have to pay money for it (like talk to an NPC near the well).

I've tested and fixed the deserted well script so it is functional and better matches our coding and story style and fixed some other issues.

Code: Select all

//

new_7-1.gat,118,70,0	script	Deserted well	127,1,0{
   mes "You hear strange noises coming from the well. Do you want to jump in?";
   next;
   
   menu "Yeah no risk, no glory!", L_yes,
        "Are you out of your mind?", L_no;

L_yes:
   warp "new_22-1.gat",81,76;
   close;

L_no:
   close;

}

Re: Deserted well - npc

Posted: 09 Sep 2008, 01:37
by 5t3v3
jaxad0127 wrote:It'd be better if they have to pay money for it (like talk to an NPC near the well).
I don't know about that, it would just be one extra "bring-me-this-I'll-give-you-that-quest"
Also what I liked about it is that you're not told how to do this, the option for empty bottles only come if you bring them. So unless you always carry them around, you will be looking for a new bucket or something for ages before you figure it out without help. When the quest is no longer diy, then that would just be odd that the npc didn't mention the bottles until you actually bring them.

Re: Deserted well - npc

Posted: 09 Sep 2008, 02:03
by Jaxad0127
5t3v3 wrote:
jaxad0127 wrote:It'd be better if they have to pay money for it (like talk to an NPC near the well).
I don't know about that, it would just be one extra "bring-me-this-I'll-give-you-that-quest"
Also what I liked about it is that you're not told how to do this, the option for empty bottles only come if you bring them. So unless you always carry them around, you will be looking for a new bucket or something for ages before you figure it out without help. When the quest is no longer diy, then that would just be odd that the npc didn't mention the bottles until you actually bring them.
This would be like a shop. The rest is easy to implement with an NPC. It is already. Just change the text so the person is saying it. Also, it'd be good if the occasional bottle is lost, to counter the drop rate of water bottles.

Re: Deserted well - npc

Posted: 09 Sep 2008, 18:33
by 5t3v3
I still prefer it without a person there, there might be other ways to balance it instead of asking for money. Off the top of my head: maybe you need to use a piece of robe for each bottle you fill?