[Help Thread] Please post your questions here.

02/08/2018 19:42 Bakkerken#6871
Quote:
Originally Posted by Dark Blaze View Post
You have:
Code:
function get_module_name()
	return "NPC_custom"
end
You should have:
Code:
function get_module_name()
	return "cookietestscript"
end
And for the NPC entry contact_script column it should be "cookietestscript()" and you can also test the script without being at the NPC using run command: "/run cookietestscript()"
Thank you for the swift reply. I have made the changes in the lua script but alas it remains the same. nothing happens when i try to interact with the NPC.

Quote:
Originally Posted by ThunderNikk View Post
Are you running on ela or lua

If you are loading the rest of your scripts as lua then you don't need to compress it.
All the other scripts as compressed so i always compress when i make changes. I'll test when i get the NPC to work if i need to compress or not. ;)
02/08/2018 20:20 sapir619#6872
Quote:
Originally Posted by Bakkerken View Post
Hi,

I am trying to add custom shops to the game but i can't get them to work. Here's what i did:

1: Added a new NPC to NPCResource and some strings to StringResource_EN for the name and text id's
2: Set the contact script as cookietestscript()
3: Created a new lua: NPC_custom.lua with the following contents

function get_module_name()
return "NPC_custom"
end
function cookietestscript()
dlg_title( "Test salesman" )
dlg_text( "Welcome, I sell a variety of useful items." )
dlg_menu( "Store", 'open_market("cookietestmarket")' )
dlg_menu( "Goodbye", '' )
end

4: Compressed the lua script
5: Created a new entry in MarketResource for cookietestmarket so the store can show an item (a CNC in this case)
6: Dumped NPCResource and StringResource_EN in the client

Testing results:
1: The servers run YAY!!!
2: The client runs YAAYY!!!!!
3: The new NPC is added with the correct title/name YAAAYYY!!!!
4: Clicking the NPC does nothing.... NAAAAYYYY =(

Why doesn't the lua script launch when i click the new NPC? As far as i understand the contact_script should launch the cookietestscript and at least show the conversation window...

Any help is greatly appreciated :)
It's been a while since I wrote anything in lua but I'll try anyway, my advice to you is to try to add 1 more row to your script, dlg_show():

function get_module_name()
return "NPC_custom"
end
function cookietestscript()
dlg_title( "Test salesman" )
dlg_text( "Welcome, I sell a variety of useful items." )
dlg_menu( "Store", 'open_market("cookietestmarket")' )
dlg_menu( "Goodbye", '' )
dlg_show()
end

GL
02/08/2018 20:37 Bakkerken#6873
Quote:
Originally Posted by sapir619 View Post
It's been a while since I wrote anything in lua but I'll try anyway, my advice to you is to try to add 1 more row to your script, dlg_show():

function get_module_name()
return "NPC_custom"
end
function cookietestscript()
dlg_title( "Test salesman" )
dlg_text( "Welcome, I sell a variety of useful items." )
dlg_menu( "Store", 'open_market("cookietestmarket")' )
dlg_menu( "Goodbye", '' )
dlg_show()
end

GL
Awesome! This fixed it! :) How silly that it just wasn't showing because it was never commanded to.

Just for the record: the edit suggested by Dark Blaze was not necessary to make it work. function get_module_name() can return "NPC_custom". I guess it refers to the lua file name like i first thought.

Quote:
Originally Posted by ThunderNikk View Post
Are you running on ela or lua

If you are loading the rest of your scripts as lua then you don't need to compress it.
You are right. i don't need to compress it :)

I guess the compression is used only when you make your server available over internet and don't want files stolen. But i'm not there yet.

i always compressed it because the initial server files had the lua and compressed files. So i thought it was mandatory.

================================================== ======================

Sadly this is not the end of the problem. The NPC works but when i open the store nothing happens. Does something other need to be done except open_market command and adding the market in marketresource?

marketresource name points to the open_market(name) right? MarketResource doesn't need client dumping because of possible exploit right?

UPDATE
changing the store ID to an existing store works
changing an item in that store in the database does not do anything

=> does this mean the marketresource needs to be dumped in the client? But isn't that an amazing exploit if you can just change stores client side?

I also remember reading somewhere in the forum that marketresource does not need to be client dumped... the RDB tool also doesn't have any database structure for it...

Can anyone give me a hint before i waste a ton of time on this little thing?
02/08/2018 23:26 ThunderNikk#6874
Check your syntax...

dlg_menu("Passes to the Hidden Village", "open_market( 'HV_Passes' )" )

Looks like you have your single a double quotes reversed.

This opens my market...

HV_Passes

Can't remember if you have to resource it to the client or not, but it is far from exploitable.

Just changing market resource in the client does not change how it is set in the server tables.
02/09/2018 00:04 Bakkerken#6875
Quote:
Originally Posted by ThunderNikk View Post
Check your syntax...

dlg_menu("Passes to the Hidden Village", "open_market( 'HV_Passes' )" )

Looks like you have your single a double quotes reversed.

This opens my market...

HV_Passes

Can't remember if you have to resource it to the client or not, but it is far from exploitable.

Just changing market resource in the client does not change how it is set in the server tables.
I ruled out the syntax problem. In this code:

function cookietestscript()
dlg_title( "Merchant Cookie" )
dlg_text( "@90408302" )
dlg_menu( "@90010187", "open_market( 'cookietestmarket' )" )
dlg_menu( "@90010187", "open_market( 'secroute_foodshop_etc' )" )
dlg_menu( "@90010002", '' )
dlg_show()
end

The line is copy pasted and only the market is changed. The second market (being an existing food shop) works, but my market does not. So i guess it needs to be resourced to the client after all. Would you mind sharing the lua database layout for the RDB tool for that? It doesn't seem to come with one for this table. Saves me the trouble of making one myself.
02/09/2018 03:30 ThunderNikk#6876
Well I am not finding an RDB for market so it really must be something else. Are you sure your market entries committed to the database table?

Run a query to make sure they went in there..

select * from arcadia.dbo.MarketResource where name = 'cookietestmarket'
02/09/2018 14:25 Bakkerken#6877
Quote:
Originally Posted by ThunderNikk View Post
Well I am not finding an RDB for market so it really must be something else. Are you sure your market entries committed to the database table?

Run a query to make sure they went in there..

select * from arcadia.dbo.MarketResource where name = 'cookietestmarket'
Yeah, they're surely in there. they show up when i sql them. Also i changed the entries of an existing shop (the grocery shop from the example), but nothing changes in game. That's why i thought a client dump would be necessary. my changes are just being ignored. which is weird because changes in other tables work right away. (drop chances, taming chances, item changes, etc...)
02/09/2018 15:36 ThunderNikk#6878
I will compare your script against mine tonight in detail and see if I can pick out anything you might be missing.

Right now without my script to compare it too I am just as stumped as you are.
02/09/2018 21:47 Bakkerken#6879
Quote:
Originally Posted by ThunderNikk View Post
I will compare your script against mine tonight in detail and see if I can pick out anything you might be missing.

Right now without my script to compare it too I am just as stumped as you are.
Sounds good. I really don't understand it. I copy pasted the working store line (from the grocery merchant) and replaced the market with the one i added in the database. Also copy pasting the market name. So typo's are pretty much ruled out. Yet the grocery store works and my store just ends the concversation.

What bothers me the most is that when I change the item codes for the existing working grocery store, the items don't change in the game. I do restart the game server after every change so that's also not it.

Doing a select on the marketresource database for my market gives me the added lines, 5 in total. Doing one for the grocery store gives me my edited lines.

This is the biggest riddle I've come across so far trying to make changes to the game.

Although this is only preparation for something a lot more difficult I'm planning afterwards.

Anyways I would like to thank you all. This forum is really helpfull and the responses/solutions never let us wait long. It is highly appreciated. :)
02/10/2018 01:49 ThunderNikk#6880
Could I bother you to see your entries in market resource.

Doesn't have to be a screen shot...just a copy paste to what you have put in there is all.
02/10/2018 12:22 Bakkerken#6881
Quote:
Originally Posted by ThunderNikk View Post
Could I bother you to see your entries in market resource.

Doesn't have to be a screen shot...just a copy paste to what you have put in there is all.
Oh wow... It's fixed. What a stupid mistake I made... I accidentally copied the name_id instead of the id from itemresource to put into marketresource. So because no id existed for the code, no items were shown. The shop needs at least 1 existing item to be able to open... I feel really embarrassed now...:(
02/10/2018 15:27 ThunderNikk#6882
No that's alright I am glad you got it fixed.
02/10/2018 21:20 TrBleZ#6883
hey there can someone help me with guild icons i can't get it to work

im useing 9.4 files with IIS all ports are open 4615 -4617

PS i have webserver with a directory for it
[Only registered and activated users can see links. Click Here To Register...]

here My Game Server
[Only registered and activated users can see links. Click Here To Register...]
Quote:
[Only registered and activated users can see links. Click Here To Register...]
S:io.upload.ip:188.132.204.165
S:io.upload.port:4617
S:upload.server_name:GosT
uploadserver

Quote:
S:app.name:GosT
S:working_dir:C:\inetpub\wwwroot\site\icon\
S:io.upload.ip:188.132.204.165
S:io.port:4615
S:io.game_server.addr:188.132.204.165
S:io.game_server.port:4617
N:console.port:1433
S:console.allow_ip:188.132.204.165
S:console.ip:188.132.204.165
S:console._password:
02/11/2018 10:19 thefear511#6884
Quote:
Originally Posted by TrBleZ View Post
hey there can someone help me with guild icons i can't get it to work

im useing 9.4 files with IIS all ports are open 4615 -4617

PS i have webserver with a directory for it
[Only registered and activated users can see links. Click Here To Register...]

here My Game Server
[Only registered and activated users can see links. Click Here To Register...]


uploadserver

make sure to have a folder in the iis directory for guild icons.
02/11/2018 10:39 TrBleZ#6885
Quote:
Originally Posted by thefear511 View Post
make sure to have a folder in the iis directory for guild icons.
thx for the Reply

:( i do have

-----

عندي الملف لو تقدر تضيفني سكايبي ممكن اوريك السيرفر عن طريق تيم فيور