From The Mana World
(→‎NPC section suggestion: Update and question)
(→‎NPC section suggestion: Updated suggestion with Mantis #470 and new format)
Line 9: Line 9:
The NPC section isn’t there yet, and while I do not know it. Here’s a beginning text someone might be able to work off from. Note that the NPC script in '''new_37-1-woodland-mine/miners.txt''' has two additional values just before the start of the script section.
The NPC section isn’t there yet, and while I do not know it. Here’s a beginning text someone might be able to work off from. Note that the NPC script in '''new_37-1-woodland-mine/miners.txt''' has two additional values just before the start of the script section.


NPCs are defined like this:
NPCs are defined like


''map'',''x'',''y'',''direction''<TAB>script<TAB>''name''<TAB>''spriteID'',[''area1'',''area2'',]{
:'''map''','''x''','''y''','''direction'''<TAB>script<TAB>'''name'''<TAB>'''spriteID''',''area1'',''area2'',{
:''script''
::''script''
}
:}


Where
Where
Line 20: Line 20:
* '''x''' is the x-coordinate of the NPC
* '''x''' is the x-coordinate of the NPC
* '''y''' is the y-coordinate of the NPC
* '''y''' is the y-coordinate of the NPC
* '''direction''' is the direction the NPC faces, not used
* '''direction''' is the direction the NPC faces, unused but must be defined
* '''name''' is the name of the NPC
* '''name''' is the name of the NPC, to hide (the latter part of) a name to the client begin (that part of) the name with a hash (#)
* '''spriteID''' is the NPC sprite identifier
* '''spriteID''' is the NPC sprite identifier
* '''area1''' and '''area2''' describe the map area which activates the NPC, optional
* ''area1'' and ''area2'' describe the map area which activates the NPC, optional
* '''script''' is the scripting code, see below
* '''script''' is the scripting code, see the section below


—[[User:Kess|kess]] 14:01, 14 October 2008 (CEST) / updated ~ 13:50, 15 October 2008 (CEST)
—[[User:Kess|kess]] 14:01, 14 October 2008 (CEST) / last updated ~ 21:10, 15 October 2008 (CEST)


: Yeah, I never got around to doing this. The first question mark is the direction (I assume facing direction, 8 compass values available), which we don't use. The second two are indeed optional. They define an activation area, which only that one NPC uses (to warn you when you get too close). The only thing we need to do is determine how the numbers for the activation area work. &mdash; [[User:Jaxad0127|<span style="color: #160196">Jaxad</span>]][[User Talk:Jaxad0127|<span style="color: #5B038F">0127</span>]] 17:51, 14 October 2008 (CEST)
: Yeah, I never got around to doing this. The first question mark is the direction (I assume facing direction, 8 compass values available), which we don't use. The second two are indeed optional. They define an activation area, which only that one NPC uses (to warn you when you get too close). The only thing we need to do is determine how the numbers for the activation area work. &mdash; [[User:Jaxad0127|<span style="color: #160196">Jaxad</span>]][[User Talk:Jaxad0127|<span style="color: #5B038F">0127</span>]] 17:51, 14 October 2008 (CEST)

Revision as of 19:09, 15 October 2008

Irving Rivas, 31/7/07:

Perhaps we should regulate comments?

EOF newline

I’d like to propose that all script files should have a mandatory newline at the end of file, to ease working with shell scripts on these files. —kess 14:01, 14 October 2008 (CEST)

NPC section suggestion

The NPC section isn’t there yet, and while I do not know it. Here’s a beginning text someone might be able to work off from. Note that the NPC script in new_37-1-woodland-mine/miners.txt has two additional values just before the start of the script section.

NPCs are defined like

map,x,y,direction<TAB>script<TAB>name<TAB>spriteID,area1,area2,{
script
}

Where

  • map is the map the NPC is located in
  • x is the x-coordinate of the NPC
  • y is the y-coordinate of the NPC
  • direction is the direction the NPC faces, unused but must be defined
  • name is the name of the NPC, to hide (the latter part of) a name to the client begin (that part of) the name with a hash (#)
  • spriteID is the NPC sprite identifier
  • area1 and area2 describe the map area which activates the NPC, optional
  • script is the scripting code, see the section below

—kess 14:01, 14 October 2008 (CEST) / last updated ~ 21:10, 15 October 2008 (CEST)

Yeah, I never got around to doing this. The first question mark is the direction (I assume facing direction, 8 compass values available), which we don't use. The second two are indeed optional. They define an activation area, which only that one NPC uses (to warn you when you get too close). The only thing we need to do is determine how the numbers for the activation area work. — Jaxad0127 17:51, 14 October 2008 (CEST)
The name is used, it shows below the npc. EJ 10:42, 15 October 2008 (CEST)
Is it possible to use name as a constant in the script part? Something like:
mes "["+@NAME$+"]";
mes "\"Dialogue...\"";
✎ Kess☽ 13:48, 15 October 2008 (CEST)