Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  npc's  (Read 52 times)

0 Members and 1 Guest are viewing this topic.

Dolfo

« on: 27, November 2021, 14:47:58 »
I walked sometime in castle complex and spoked to npc's. Mostly they answered with :
"X has nothing to say".

It's one line in lua to output data to a player. I found in lothar.lua

pl:Write("Lothar shouts: "..text, game.COLOR_YELLOW)

Think of a default guard script, where guard have 10 better 20 or more textlines, he can talk randomly.

I found syntax of random generator in sahrel_taunt.lua

So you can put your 10/20 textlines in an array, and generate a random output like in sahrel_taunt.lua

On german we call it EVA principle (Eingang/Input, Verarbeitung/Processing, Ausgang/Output)

So output logic and processing logic to generate a random output is there and it's few lines of coding you can copy/paste.

I still study you game structures.

For an interesting basic default guard script you need 2 triggers.

One is triggered if a player saying Hi to the guard. Other is triggered when a player runs near a guard. We have both in lothar.lua.

Then it's "only" a connection of this three logics. I personaly would go for a 100% trigger on HI and a 5-10% chance to trigger when player walking near the npc.

Here are some guard text ideas.

"I watch you!"
"Don't make trouble!"
"Don't look at me!"
"Keep walking!"
...

This is only a first step, of course you need to bind this to all the "2.Class" guards in Castle. I think you bind this in maps?

Later you can improve EVA principe. Think of different reaction to a player level, or a player titel. So guards are more unfriendly to new low players and later they start output textes more personaly with the player name, Like
"Hi, playername, nice to see you again."
Hero players they generate outputs like
"I am proud to know you, playername." *sorry my english here
You can also go finally for a kind of
"My lord" on player heros

But first step is to build a basic and simple defaultguard.lua script and implement this on the guards.





« Last Edit: 27, November 2021, 14:57:02 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

_people_

« Reply #1 on: 28, November 2021, 05:50:12 »
Though it's criminally underutilized (due to laziness), our NPC dialogue interface is very robust. Such a feature already exists (for the small number of NPC's which use it). NPC's have "localities" which give them rumours. So compatible NPC's can discuss rumours specific to their town/plane or even global rumours (gossip about other NPC's in the town, hints toward game secrets, etc.).

The only issue is that many of our NPC scripts still need to be converted to use the feature. Because the game has undergone so many huge changes to the underlying code, existing scripts implement the same functionality many different ways. As such, most of them would require a complete rewrite to use the newest system.

I'll try to put some time into updating some of these. There's also a "gossip" script somewhere in Tetranesia wherein a couple of NPC's are shouting gossip at each other (and IIRC they get quiet if there's a player too close). Would be fun to copy that script in a few places.
-- _people_ :)

Dolfo

« Reply #2 on: 01, December 2021, 13:59:01 »
Your entry hurdle for other human beings is so high. I mean there are lots of creative humans outside, lot's of ideas and they can't help, because of the initial work to master. For example currently i have lots of ideas for npc's behavior in lua, but i can't help, excepting posting ideas here in forum. I work on that, i rent a server for 1€ montly. I come closer, but have also some real shit do to first. My room is attacked by EMF from all sites. Need to rearange my rooms. EMF is invisible, but not harmless. Radioation is always, how strong, how long you are inside this. Sorry go offtopic here. But it's important. So much humans don't know, what danger lies in radition. Later they are diagnostic with cancer and doctors finish there life with chemotherapy, killing there last biological protection to fight against cancer. Human biological system can fight cancer, but not if doctors kill your defense with chemo or antibiotika.

But back to topic. I hope i can compile your server soon, so i can try some lua scripting on npc's.
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #3 on: 30, December 2021, 11:48:23 »
I have build a very basic script showing my idea. Don't used arrays for this. But it upgrades castle guards.
Code: [Select]
local pl = event.activator
local me = event.me

if pl.level<11 then -- 11 means player is strong enough to fight on demon plane
local rnd = math.random(4)
-- pl:Write(rnd)
if rnd == 1 then
pl:Write("I watch you!")
elseif rnd == 2 then
pl:Write("Don't make trouble!")
elseif rnd == 3 then
pl:Write("Don't look at me!")
elseif rnd == 4 then
pl:Write("Keep walking!")
end

elseif pl.level <100 then
pl:Write("Hi, " .. pl.name .. ", nice to see you again.")
elseif pl.level <110 then
pl:Write("I am proud to know you, " .. pl.name .. ".")
else
pl:Write("My lord, I am proud to serve you.")
end
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Tags:
 

Related Topics

  Subject / Started by Replies Last post
16 Replies
10067 Views
Last post 01, December 2005, 00:05:12
by jessek
0 Replies
1886 Views
Last post 16, May 2005, 09:08:07
by polyveg
3 Replies
565 Views
Last post 21, October 2005, 22:46:41
by Gurney
21 Replies
4611 Views
Last post 11, September 2010, 21:37:04
by smacky
11 Replies
5343 Views
Last post 21, April 2007, 09:49:11
by Talwoasc