Jump to content
  • 0

I need help


nothing456

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  09/18/13
  • Last Seen:  

I'm starting to script now and I need help with some stuff and I'm having a hard time finding the answers and nobody responds to the IRC Webchat. I saw another chat link last time but I wasn't able to bookmark it and now I cant find it. 

 

Anyway... 

#1

I need help with Scripting.

I want to make an NPC that you can whisper to and when you enter your whisper, it will pop up a website.

I want the actual website to pop up in a window and not a dialogue box with a link.

 

#2

I think this will be common. I need a script that can loop back to a menu.

like those NPCs in the newbie grounds that explain stuff and then loop back to the menu for you to choose a topic. 

 

#3

Lastly, I need a script that can pop up images in game.

like ingame card images, ingame item images, those NPC images like kafra and also other misc. images if you have a direct link.

 

I hope somebody can help me or can refer me to the correct places.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts


  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

1. I'm not sure, but, as far as I know, the website is only opnened once the link is clicked on a message box.
 

2. The easiest way to do it is by Labels

Labels
------

Within executable script code, some lines can be labels:

<label name>:

Labels are points of reference in your script, which can be used to route 
execution with 'goto', 'menu' and 'jump_zero' commands, invoked with 'doevent' 
and 'donpcevent' commands and are otherwise essential. A label's name may not be 
longer than 22 characters. (23rd is the ':'.) There is some confusion in the 
source about whether it's 22, 23 or 24 all over the place, so keeping labels 
under 22 characters could be wise. It may only contain alphanumeric characters 
and underscore. In addition to labels you name yourself, there are also some 
special labels which the script engine will start execution from if a special 
event happens:

OnClock<hour><minute>:
OnMinute<minute>:
OnHour<hour>:
On<weekday><hour><minute>:
OnDay<month><day>:

This will execute when the server clock hits the specified date or time. Hours 
and minutes are given in military time. ('0105' will mean 01:05 AM). Weekdays 
are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 to 31. 
Remember the zero. 

OnInit:
OnInterIfInit:
OnInterIfInitOnce:

OnInit will execute every time the scripts loading is complete, including when 
they are reloaded with @reloadscript command. OnInterIfInit will execute when 
the map server connects to a char server, OnInterIfInitOnce will only execute 
once and will not execute if the map server reconnects to the char server later.

OnAgitStart:
OnAgitEnd:
OnAgitInit:
OnAgitStart2:
OnAgitEnd2:
OnAgitInit2:

OnAgitStart will run whenever the server shifts into WoE mode, whether it is 
done with @agitstart GM command or with 'AgitStart' script command. OnAgitEnd 
will do likewise for the end of WoE.

OnAgitInit will run when data for all castles and all guilds that hold a castle 
is received by map-server from the char-server after initial connect.

No RID will be attached while any of the above mentioned labels are triggered, so 
no character or account-based variables will be accessible, until you attach a 
RID with 'attachrid' (see below).

The above also applies to, the last three labels, the only difference is that
these labels are used exclusively for WoE SE, and are called independently.

OnInstanceInit:

This label will be executed when an instance is created and initialized through
the 'instance_create' command. It will run again if @reloadscript is used while
an instance is in progress.

OnTouch:

This label will be executed if a trigger area is defined for the NPC object it's 
in. If it isn't present, the execution will start from the beginning of the NPC 
code. The RID of the triggering character object will be attached.

OnTouch_:

Similar to OnTouch, but will only run one instance. Another character is
chosen once the triggering character leaves the area.

OnTouchNPC:

Similar to OnTouch, but will only trigger for monsters. For this case, by using
'getattachedrid' will returns GID (ID that returned when use 'monster').

OnPCLoginEvent:
OnPCLogoutEvent:
OnPCBaseLvUpEvent:
OnPCJobLvUpEvent:

It's pretty obvious when these four special labels will be invoked.

OnPCDieEvent:

This special label triggers when a player dies. The variable 'killerrid' is
set to the ID of the killer.

OnPCKillEvent:

This special label triggers when a player kills another player. The variable
'killedrid' is set to the ID of the player killed.

OnNPCKillEvent:

This special label triggers when a player kills a monster. The variable
'killedrid' is set to the Class (mob ID) of the monster killed.

OnPCLoadMapEvent:

This special label triggers when a player steps in a map marked with the 
'loadevent' mapflag and attaches its RID. The fact that this label requires a 
mapflag for it to work is because, otherwise, it'd be server-wide and trigger
every time a player would change maps. Imagine the server load with 1,000 players
(oh the pain...)

OnPCStatCalcEvent:

This special label triggers when a player's stats are recalculated, such as when
changing stats, equipment, or maps, as well as when logging in, leveling up, and
mounting a job mount. This can be used to grant additional item bonuses to certain
player groups, for instance.

OnWhisperGlobal:

This special label triggers when a player whispers the NPC, and will run with the
player's RID attached. It can accept up to ten parameters, which will be stored
into separate temporary character string variables @whispervar0$ to @whispervar9$.
See 'doc/whisper_sys.txt' for further documentation.

Only the special labels which are not associated with any script command are 
listed here. There are other kinds of labels which may be triggered in a similar 
manner, but they are described with their associated commands.

On<label name>:

These special labels are used with Mob scripts mostly, and script commands
that requires you to point/link a command to a mob or another NPC, giving a label
name to start from. The label name can be any of your liking, but must be

Example:

monster "prontera",123,42,"Poringz0rd",2341,23,"Master::OnThisMobDeath";

amatsu,13,152,4	script	Master	767,{
	mes "Hi there";
	close;

OnThisMobDeath:
	announce "Hey, "+strcharinfo(0)+" just killed a Poringz0rd!",bc_blue|bc_all;
	end;
}

Each time you kill one, that announce will appear in blue to everyone.

"Global" labels

There's a catch with labels and doevent. If you call a label (using doevent)
and called label is in NPC that has trigger area, that label must end with
"Global" to work globally (i.e. if RID is outside of the trigger area, which
usually happens since otherwise there would be no point calling the label with
doevent, because OnTouch would do the job). For further reference look for
npc_event in npc.c.

3. You may use the Cutin command to get that kind of result:

*cutin "<filename>",<position>;

This command will display a picture, usually an NPC illustration, also called
cutin, for the currently attached client. The position parameter determines the
placement of the illustration and takes following values:

    0 - bottom left corner 
    1 - bottom middle 
    2 - bottom right corner 
    3 - middle of screen in a movable window with an empty title bar 
    4 - middle of screen without the window header, but still movable 

The picture is read from data\texture\유저인터페이스\illust, from both the GRF archive
and data folder, and is required to be a bitmap. The file extension .bmp can be
omitted. Magenta color (#ff00ff) is considered transparent. There is no limit
placed on the size of the illustrations by the client, although loading of large
pictures (about 700x700 and larger) causes the client to freeze shortly (lag).
Typically the size is about 320x480. New illustrations can be added by just
putting the new file into the location above.

The client is able to display only one cutin at the same time and each new one
will cause the old one to disappear. To delete the currently displayed
illustration without displaying a new one, an empty file name and position 255
must be used.

    // Displays the Comodo Kafra illustration in lower right corner.
    cutin "kafra_07",2;

    // Typical way to end a script, which displayed an illustration during a
    // dialog with a player.
    mes "See you.";
    close2;
    cutin "",255;
    end;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  09/18/13
  • Last Seen:  

Oooooo, fast response (dunno if it helps in this forums but reputation given @Haziel).

 

I tried the labels and it seemed to work well (though i need some meditation on how to properly assemble my very wordy NPC).

I'll try the Cutin once I am done with labeling.

 

Now I need a little help with variables.

the sample i found wasn't working well when i tried it on a test NPC it's it raw form.

 

 

++.@var1;

mes "[Forgetfull Man]";
if (.@var == 1) mes "This is the first time you have talked to me";
if (.@var == 2) mes "This is the second time you have talked to me";
if (.@var == 3) mes "This is the third time you have talked to me";
if (.@var == 4) mes "This is the forth time you have talked to me, but I think I am getting amnesia, I have forgotten about you";
if (.@var == 4) .@var = 0;
close;

 

my test npc:

 

geffen,129,67,5 script Linx 895,{

++.@var1;
mes "[Linx]";
if (.@var == 1) mes "This is the first time you have talked to me";
if (.@var == 2) mes "This is the second time you have talked to me";
if (.@var == 3) mes "This is the third time you have talked to me";
if (.@var == 4) mes "This is the forth time you have talked to me, but I think I am getting amnesia, I have forgotten about you";
if (.@var == 4) .@var = 0;
close;
}
Edited by nothing456
Link to comment
Share on other sites


  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

I guess the problem in your Script is the type of the variable.

The .@var is a scope one, which means it only lasts for the instance, once you end the conversation with de NPC, it vanishes.

A @var will be attached to the player until it logs out.

var will be permanently attached to it.

Also, you can use { } to expand a content of an If:

if (condition) {
	do it;
	and it;
}
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  513
  • Reputation:   83
  • Joined:  08/11/12
  • Last Seen:  

I'm starting to script now and I need help with some stuff and I'm having a hard time finding the answers and nobody responds to the IRC Webchat. I saw another chat link last time but I wasn't able to bookmark it and now I cant find it.

https://discordapp.com/channels/96459614895226880/96459614895226880

Anyway... 

#1

I need help with Scripting.

I want to make an NPC that you can whisper to and when you enter your whisper, it will pop up a website.

I want the actual website to pop up in a window and not a dialogue box with a link.

I don't think this is possible, you might need a source mod for this. but anyway, here's something that will popup a dialogue box with a link if you whisper "npc:test" ingame with just anything.

-	script	test	-1,{
OnWhisperGlobal:
mes "<URL>facebook page<INFO>http://www.facebook.com/</INFO></URL>";
end;

}

#2

I think this will be common. I need a script that can loop back to a menu.

like those NPCs in the newbie grounds that explain stuff and then loop back to the menu for you to choose a topic.

you can do it like this:

set .@loop, 1;
while(.@loop){
<scripts here>
}

#3

Lastly, I need a script that can pop up images in game.

like ingame card images, ingame item images, those NPC images like kafra and also other misc. images if you have a direct link.

right now, I think you can use cutin and cutincard.

Edited by jezznar
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  09/18/13
  • Last Seen:  

Cutin works fine /ok

and after adding specialeffect and emotion it has some body to it!

 

also thanks for the link /no1

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...