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 trader  (Read 35 times)

0 Members and 1 Guest are viewing this topic.

Dolfo

« on: 12, January 2022, 23:01:57 »
Here is a early prototyp of an npc trader. I will try to build it max dynamic, so you only need to adjust the for_sale array. It uses the new lua function CreateObject and read data from object to build the shop.

I also tried to build it a one click solution, without this double asking, if player really want to buy. You click you get it, simple. It's like the drop item in shop, You drop you have sold. No undo function.

Next is: It needs money and weight calculation, i also have an idea how to adjust amount and level with mouse and i will try to store these values in datastore. So player can adjust a personal favorite amount to buy.  ::)

https://github.com/Kamor/Dolfo/blob/main/maps/scripts/trader.lua
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 #1 on: 13, January 2022, 18:21:44 »
What a pain. Coding complex logics in lua is a jigsaw. Don't know how people made a dynamic dungeon scripted in lua? This is torment yourself. Handling the datastore engine has costs me also some time to understand the logic, when server saves it to file. Using the interfacebuilder is also somehow strange, when it restarts full script each time we click a topic. Using the side topics are also limited, because you need to implement an equivalent text and all normal texts are always above the select options. My idea was to put it under the selects.  :(

But i build something. In relation to all this prisons, it looks not that bad. Currently it can only adjust nrof 1-9 and level 1-9. There is also a strange logic, how to handle the parameters for interface builder. So a diggit (%d) is currently 0 to 9, need to read deaper, how you have implemented %d there or if there is a number for parameters. If not i try string %s for numbers. ???

But it works, prices goes up by nrof and level. There is no waycheck when buying, i think PickUp handles this and drops to much stuff on ground. I must test this. If player want to buy more, than they can carry, sure, why not. We drop it on ground. No seller says to you, "Ey you can't carry this, i don't sell so much to you."

It's still an early prototyp, need some more fixes. Same link than above.  :o
« Last Edit: 13, January 2022, 18:30:12 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 #2 on: 14, January 2022, 00:53:50 »
I sent you this in a DM before I saw this thread: https://www.daimonin.org/daipedia/SENTInceSummary

It's not complete, but it's got a lot of good info in it especially if you read the "see also" articles.

I also just posted a DataStore tutorial, though I might move it to the Daipedia (though there might be one there already, I forgot to check).

You can use (%d+) to match more than 1 digit. I'm not sure if there are any server or client limitations on how many selections there can be, though.
-- _people_ :)

Dolfo

« Reply #3 on: 14, January 2022, 11:32:06 »
%d+ works fine, thx. Script works now with level 1-110 and nrof 1-1000.

I looked deeper in your structures. I always forget that this is server/client coding. So most problems are in client now. Client shows numbers in "select items" fixed from center to right, so 1000 looks ugly over this icon. 999 has also not the best look. And yeah i know you are writing on a new client. Current client has also a problem, when you put a ^hyperlink^ in the description block like this
Code: [Select]
ib:AddDesc("test ^level 9^") -- hyperlink is broken here, shows empty body when mouse is over link.
And description also goes over the selects. So i need to find a better way adjusting level and nrof with mouse.

With command it works very good now. type nrof 1000, type level 110 and you can buy 1000 level 110 scrolls with one click. I still need to test the weight logic there. But step by step.

I looked client code and had and idea. This side menu for hyperlinks is very strong feature. But currently it's limited to visible hyperlinks. If we allow invisible hyperlinks, we can build cool site menus. It must be not that much on client to change? A kind of clone from ^hyperlink^ build the link, but not showing the text in messagebody? Syntax could be equivalent to ^hyperlink^ like °invisiblelink°. But before i must manage to compile the client. I like coding, but not the environment build "shit" before.

Coding for hypertext in client is here: interface.c line 951  :o
« Last Edit: 14, January 2022, 11:46:07 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.

Tags:
 

Related Topics

  Subject / Started by Replies Last post
11 Replies
813 Views
Last post 03, February 2007, 11:59:23
by grommit
Potions Trader

Started by Torchwood « 1 2 » Scripts

20 Replies
2452 Views
Last post 10, September 2007, 00:10:59
by drace
6 Replies
1512 Views
Last post 14, January 2010, 12:32:57
by smacky
6 Replies
2759 Views
Last post 18, September 2016, 23:12:46
by Joe
npc's

Started by Dolfo Suggestions

3 Replies
51 Views
Last post 30, December 2021, 11:48:23
by Dolfo