Page 2 of 3

Posted: Sat May 17, 2008 2:23 pm
by Estralis Seborian
Can you elaborate on the following commands: busy, idle, begin, end?

begin sets the "status" of the NPC to busy - forever? Or will the NPC turn idle by itself with time?

end sets the status to idle, right?

idle means the NPC walks around?

busy means the NPC stops? For how long?

So, when I script the following, what happens? Is the "busy" state bond to a character? Like, when char A talks to the NPC, does he get treated different as character B when A has said "hello" as the first one?

"hello",idle->"Hi there", begin
"hello",busy->"Get lost, I am busy"
"bye",busy->"Yeah, bye", end

*puzzled*

Posted: Thu Jun 26, 2008 11:05 am
by LifeWonder
As players, we are limited to a certain amount of characters we can submit when doing a #me or normal speech. Are NPCs limited to how much they can say in a single line too?

Posted: Thu Jun 26, 2008 11:38 am
by Nitram
They are limited as well. But for very long lines the NPC will split the text automatically and says it in 2 lines.

But you should know that this looks crappy for #me's

Nitram

Posted: Thu Jun 26, 2008 11:47 am
by LifeWonder
Thanks

Posted: Sun Jun 29, 2008 1:52 am
by Tanistian_Kanea
for finding location what i 1) you are not working on the script on a computer with internet. or 2) the server is down and you are unable to get the location or 3) the place you wish to put the npc is to dangerous for any inexperienced fighters to get to (like all of mine) but you wish to put this npc there to make a quest more difficult by using natural monsters.

also, is it possible to create npc's who defend themselves? but not start fights with others.

edit: also in martin's example the npc heals. how much health and food does a character actually have?

also, to think of creating guards what would happen if the command was just:
item(1, body)
"sword", item(1, body) <------ what it looked liked.
as the condition? i'm thinking like a guard to a sanctuary. no swords allowed type thing that would affect those that went bye.

edit2: another question, how is it scripted that npc merchants only have os much money or have only so many items to sell. or is this done automatically?

edit3: i can't figure out what is wrong with this. can someone help?
Parser Error
Message: Invalid Input
Line: 31
At: item(4,belt)

Posted: Sun Jun 29, 2008 6:03 am
by Juniper Onyx
Tanistian_Kanea wrote: item(4,belt)
I think you need a space after the comma.

Posted: Sun Jun 29, 2008 8:13 am
by pharse
no, you need a compare value

Code: Select all

item(1,all)>0

Posted: Sun Jun 29, 2008 8:15 am
by Juniper Onyx
pharse wrote:no, you need a compare value

Code: Select all

item(1,all)>0
Yeah, that's what I meant. :lol:

Posted: Sun Jun 29, 2008 5:05 pm
by Tanistian_Kanea
thanks works now.

Posted: Wed Oct 29, 2008 3:11 pm
by Estralis Seborian

Code: Select all

deleteitem(<ID>,<amount>)
    <amount> items with item-ID <ID> are deleted from the characters inventory.
Is it possible to delete ALL items of one kind from the inventory?

Posted: Thu Nov 06, 2008 5:29 pm
by Estralis Seborian

Code: Select all

"deliver gold",item(234,all)>0->"At least some gold. Unless you deserve to be released - work!",deleteitem(234,expr(item(234,all))
Will this do the job to delete all gold nuggets?

Posted: Thu Nov 06, 2008 5:32 pm
by Nitram

Code: Select all

"deliver gold",item(234,all)>0->"At least some gold. Unless you deserve to be released - work!",deleteitem(234,0)

Posted: Mon Dec 15, 2008 5:26 am
by Zananex Zane
i love how relatively simple this scripting language is! Very user-friendly. Needless to say, I'll probably run into some errors, but from the looks of it they will only be syntax errors most the time. Of course, debugging is a normal and probably the most common and lengthy part of scripting, more so than learning how to actually use it.



Cheers, I'll think of some useful NPCs, or rather some not-so-useful npcs that just brighten up the game with some helpful tips or funny comments and the like.

Posted: Fri Sep 04, 2009 3:09 am
by Juniper Onyx
Thought I'd bring this old topic back to the top for players with 'admonishments'.

Please read the first thread for a Manual from Martin and examples from Nitram.

Have fun scripting! :D

Posted: Fri Sep 11, 2009 4:20 pm
by Rincewind
Uh, ich hab das schon öfters irgendwo gelesen kanns jetzt aber nicht mehr finden.

Wieviele zeichen kann ein NPC maximal auf einen Trigger ausgeben? (inclusive Leerzeichen)

danke für Eure hilfe
Rince

Posted: Fri Sep 11, 2009 4:33 pm
by martin
Das ist lediglich begrenzt durch die Sinnhaftigkeit, einen 20-Seiten-Text im Spiel zu lesen, den dir der NPC beantwortet.
Sprich: Technisch gibts keine Beschränkung, aber es gibt Grenzen dessen, was als sinnvoll zu bezeichnen ist.

Inklusive Leerzeichen.

Martin

Posted: Tue Sep 22, 2009 12:19 am
by Rincewind
An wen darf ich mich wenden um, ID's für verschiedene Items zu erhalten?

Beste Grüße
Rincewind

Posted: Tue Sep 22, 2009 2:10 am
by Felidae
Item-IDs kann dir jeder GM nennen. Such dir einfach einen aus :wink:

Posted: Tue Sep 22, 2009 4:44 pm
by Rincewind
Quasi könnt ich auch dich darum bitten, oder? :wink:

Außerdem wäre es toll jemanden vom Staff zu haben, der Qualität und Preis festlegt.
Wie gehe ich das am Besten an?

lg
RInce

Posted: Tue Sep 22, 2009 6:00 pm
by Estralis Seborian
Rincewind wrote:Außerdem wäre es toll jemanden vom Staff zu haben, der Qualität und Preis festlegt.
Wie gehe ich das am Besten an?
http://illarion.org/community/forums/pr ... ost&u=4132 :-P

Posted: Tue Sep 22, 2009 9:40 pm
by pharse
New Command

You know those blue informs e.g. during the crafting process? You can now use them with the simple NPC scripting language. The player will get the inform after the NPC said something.

Syntax:

Code: Select all

inform( <text> )
Example:

Code: Select all

"tell secret" -> "Secret? What ... what secret? I really don't know what you mean.", inform( Somehow you feel that he knows more. Perhaps you should ask again and either offer him some 'money' or threaten him with the 'guards'. )
If you add more than one inform to a trigger then one of them is randomly chosen.

Posted: Sun Oct 04, 2009 3:21 pm
by Rincewind
pharse wrote:New Command

You know those blue informs e.g. during the crafting process? You can now use them with the simple NPC scripting language. The player will get the inform after the NPC said something.

Syntax:

Code: Select all

inform( <text> )
Example:

Code: Select all

"tell secret" -> "Secret? What ... what secret? I really don't know what you mean.", inform( Somehow you feel that he knows more. Perhaps you should ask again and either offer him some 'money' or threaten him with the 'guards'. )
If you add more than one inform to a trigger then one of them is randomly chosen.
Is it possible to use functions like:

Code: Select all

inform( %npcname smiles at you and handles expr(%NUMBER*10) coins. )
:?:
greetings
Rincewind

Posted: Sun Oct 04, 2009 3:49 pm
by Nitram
the npc name stuff works. The expression does not work out.

Nitram

Posted: Sat Oct 10, 2009 12:55 pm
by Pellandria
Ist es möglich das ein Npc ein Gegenstand zufällige Attribute gibt?

Ich hätte eine Idee für einen "Bandit/Glücksspieler", dem man einen bestimmten Geldbetrag gibt und der mittels Skript "Itempools" durchläuft, sagen wir mal wir haben Itempool A, B und C.

Der Char gibt dem Händler 20 Münzen und will auf Itempool A setzen, dann gibt es in diesem Itempool weitere Unterteilungen.

Nehmen wir einfach mal an das Itempool A Werkzeuge sind, der Spieler will aus dne Werkzeugen einen Hammer haben, also gibt er dem Händler 20 Kupfer, daraufhin geht das Script de Chancen durch, 80% das er bei Itempool A landet, jeweils 10% das er woanderst landet.

Sollte der Spieler Glück haben und bei A landen gibt es ein weiteres Script, darin sind nun schlicht alle "Werkzeugid's" enthalten, wieder gibt es einen hohen Prozentsatz, dass er den Hammer bekommt, jedoch auch geringe Chancen das ein anderes Werkzeug ausgesucht wird.

Aber wieder haben wir Glück und landen auf dem Hammer, nun geht es um die Qualität und hier eigentlich meine Kernfrage, kann man dem Script sagen das es nun einen zufällig gewählten Wert von 0 bis 999 wählen kann und dann mal einen guten und mal einen schlechten Hammer erschafft, oder muss man dem Hammer vorgefertigte Items geben, die dann wieder über Chance verteilt werden, je höher der gegebene Geldbetrag, desto besser sollten natürlich diee Chancen sein.

Posted: Wed Oct 21, 2009 9:23 am
by Pellandria
Gibt es einen einfacheren Weg folgendes zu schreiben?

"Kaufe Werkzeug", german, chance(20), queststatus=0-> queststatus=11
"Kaufe Werkzeug", german, chance(25), queststatus=0-> queststatus=10
"Kaufe Werkzeug", german, chance(30), queststatus=0 -> queststatus=9
"Kaufe Werkzeug", german, chance(35), queststatus=0 -> queststatus=8

Gibt es zudem die möglichkeit das der Npc von sich aus eine aktion durchläuft, wäre sozusagen ohne das der Spieler ihm nochmal Informationen gibt?

"Kaufe Werkzeug", german, chance(20), queststatus=12-> queststatus=11
"Kaufe Werkzeug", german, chance(25), queststatus=12-> queststatus=10
"Kaufe Werkzeug", german, chance(30), queststatus=12-> queststatus=9


questatus=11->"Ohh du hast Glück und bist auf xyz gelandet" questatus=13
questatus=10->"Ohh du hast Glück und bist auf abc gelandet" questatus=14
questatus=9->"Leider Pech, eine Niete" questatus=0

chance(20), queststatus=13->"Ohh du hast einen guten Hammer gewonnen!", item(23,1,999,0), questatus=0
chance(30), queststatus=13->"Ohh du hast einen Hammer gewonnen!", item(23,1,666,0), questatus=0
chance(40), queststatus=13->"Nimm dein Preis und verschwiden, du verschreckst meine Kunden", item(23,1,333,0), questatus=0

chance(20), queststatus=14->"Ohh du hast eine gute Schaufel gewonnen!", item(24,1,999,1), questatus=0
chance(30), queststatus=14->"Ohh du hast eine Schaufel gewonnen!", item(24,1,666,1), questatus=0
chance(40), queststatus=14->"Nimm dein Preis und verschwiden, du verschreckst meine Kunden", item(24,1,333,0), questatus=0

Posted: Wed Oct 21, 2009 1:42 pm
by Nitram
Also zu deiner ersten Kernfrage: Ich könnte zwar einen einfachen Zufallsgenerator mit einbauen, aber den dann noch zu Skalieren über einen Betrag der Eingezahlt wird, das geht dann über die Fähigkeiten der einfachen NPC sprache hinaus.

Ich wüsste nicht mal wie ich das in der einfachen NPC Sprache formulieren sollte damit sie einigermaßen "einfach" bleibt. Also sowas geht dann nur noch mit Lua.

Zu deiner Zweiten Frage:

Nein es gibt keinen einfacheren Weg, aber ich glaube das diese Zeilen nicht das machen was du denkst. Mit chance muss man sehr aufpassen.
Die erste Zeile macht genau das was du willst. Mit einer Wahrscheinlichkeit von 20% funktioniert das und der Queststatus wird auf 11 gesetzt. Die zweite Zeile macht schon etwas anderes. ;-) Diese Zeile wird nur mit einer Wahrscheinlichkeit von 80% überhaupt erreicht und mit einer Wahrscheinlichkeit von 25% ausgeführt. Daher ist die "echte" Wahrscheinlichkeit mit der sie ausgeführt wird 80% * 25% = 20%. Die nächste Zeile wird also mit 60% Wahrscheinlichkeit erreicht und mit 30% Wahrscheinlichkeit ausgeführt. Das führt zu 60% * 30% = 18%. Also wird die letzte Zeile noch mit 42% Wahrscheinlichkeit erreicht und mit 35% Wahrscheinlichkeit ausgeführt. Da haben wir noch 42% * 35% = 14,7%. Daher wird mit einer Wahrscheinlichkeit von 27,8% keine der vier Zeilen ausgeführt.

Weitere aktionen ausführen kann der NPC nicht. Weil ohne eine Referenz auf den Spieler weis er ja nicht mit welchem Spieler er gerade interagiert.

Nitram

Posted: Wed Oct 21, 2009 3:06 pm
by Pellandria
Also währe bei der Berechnung
Chance(50)->x
Chance(50)->y
Chance(100)->z

Die Wahrscheinlichkeit 50%, 25% und 25%, wobei Chance jedoch wieder auf hundert springt, sobald neue Befehle ausgegeben werden, oder?

Würde man jetz z.B.
qs=10, status=1, Chance(50)->x
qs=10, status=1, Chance(40)->y
qs=10, status=2, Chance(50)->z
qs=10, status=1, Chance(50)->t

haben, würde bei T wieder die hundert Prozent benutzt werden um die Chance zu errechnen, oder nimmt das Script die Rechstwahrscheinlichkeit?

Posted: Wed Oct 21, 2009 5:53 pm
by Nitram
Das Script arbeitet viel primitiver als du denkst ;)

Es Arbeitet die Befehle von oben nach unten ab. Wenn da eine Chance von 50% steht wird diese Zeile mit einer Wahrscheinlichkeit von 50% ausgeführt. Wenn nicht vergisst das Script alles wieder und arbeitet einfach die nächste Zeile ab. Wo die Wahrscheinlichkeit das er überhaupt zur nächsten Zeile gekommen ist ja aber nur noch bei 50% liegt.

Nitram

Posted: Sat Feb 13, 2010 1:54 pm
by HeXiS
since i'm trying to make a wandering merchant.. she only sells and does not buy but. what i want to know is if there is a list of item numbers so i can fill those in where i need to? and will the images of the items she sells pop up on it's own or do i need to add that in too .. if so how? mainly i just want to know if there is a list of items with numbers.

Posted: Sat Feb 13, 2010 3:30 pm
by Blay
There is a list, but it's not public. The best way is to write the item's names he sells/buys as a comment into the script, so a dev can "convert" it to the trading system - since there will be changes with the VBU.