Jump to content
  • 0
Sign in to follow this  
canditw

showevent command

Question

Hi i was wondering how does the showevent command works? Can anyone paste a simple script of a showevent (quest) on an npc?

Heres my script but it doesn't show the quest icon.

 

 

 
new_1-1,58,112,5    script    Skia   888,{
 
showevent 1,1;

mes "Hello";

close;
end;

}



 

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

The script you have is not exactly wrong. It shows the quest icon when you click on the npc.

However I assume you want it to show a quest icon when they see the npc.

A simple method is to use OnPCLoadMapEvent

 

I have all of my OnPCLoadMapEvent: in a single file and then I link them to npcs to keep it organized. 

But you can do something like:

 

new_1-1,58,112,5    script    Skia    4_M_ZONDAOYAJI,{
    mes "Hello";
    close;
    end;
 
OnPCLoadMapEvent:
    if( #accountvar != 1 ) {
        showevent 1,1;
        end;
    }
    end;
 
}
new_1-1    mapflag    loadevent

 

You can use this with a combination of other things such as on touch or onlogin. Just be careful and make sure it is all organized.

Share this post


Link to post
Share on other sites
  • 0

@@Nihad

Yes, this works very well. But I noticed OnPCLoadMapEvent only works if the players loads the map. What if, lets say I want it to turn off showevent after the player talked to the npc.


For example talking to the npc, sets a variable but is there any other triggers to deactivate the showevent. Because if I put it under OnPCLoadMapEvent, the player will have to revisit the map to make the showevent disappear.
 

 

set new,3;

 

if ( new == 3 ) {
showevent 0,0;

end;
}



 

 

Share this post


Link to post
Share on other sites
  • 0

You can easily get around that by doing something like this:

 

#accountvar = 1;
getmapxy .@map$, .@x, .@y, 0;
warp .@map$, .@x, .@y;
end;
 
From the player's perspective it will look like they used @refresh where as in reality they were just warped on top of their current location. 

Share this post


Link to post
Share on other sites
  • 0

I never used it, but I'd more likely use an OnTouch event or something like that. As long as the distance provided for the touch area is high enough. If you enter in an area of 10*10 around the npc (or more), the popup will trigger.

 

It should work and prevent players to reload the map or force warp them. 

But still, the OnLoad should work too.

 

To make it disappear, I suppose you just have to recall the showevent on dialog completion.

Share this post


Link to post
Share on other sites
  • 0

I want it to turn off showevent after the player talked to the npc.

 

 

Insert this in the first part of your npc dialogue script to remove existing showevent:

showevent QTYPE_NONE,0;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.