Jump to content

Coxis Shop


Dr_Cox1911

Recommended Posts

Greetings,

 

I was looking into the Last Stand shop system the last couple of hours and "built" a version for SP/MP.

It´s not really a mod written by me, mora straight copy from RJ´s code. Hope it´s OK RJ:blush:

 

What´s the mod for?

Coxis Shop gives you money for each zed killed. With said money you can then buy gear/skills.

Quick look:

Spoiler

poster.png

 

Video:

 

 

Does this work in MP/Splitscreen?

I´ve tested it with dedicated server and it worked, hosting through the main game is not support currently. I didn´t had the chance to test it in splitscreen, but it should give both players money when one of them kills a zombie.

 

What language is supported?

The mod currently supports german and english.

 

Can I configure the items/skills available?

As of version 1.2.0 yes, you can! Atleast for the items, skills are not configurable just now.

Apart from the items you can set the amount a player receives and on what probability. If you use the mod in MP the settings made on the server will be transmitted to the client upon connecting. After you have changed something you need to restart the server.

 

Here is a short description on how to configure the mod:

Spoiler

Shipped with the mod comes a file named „CoxisShopSettings.ini“. If you downloaded the mod through github you should find it in „Zomboid\mods\CoxisShop“, if you got it from the Steam workshop its located under „Steam\steamapps\workshop\content\108600\786594784\mods\CoxisShop“.

 

The file is structured like a normal ini-file, that means there are sections (indicated with []) and keys with values (under the sections)

 

Let´s have a look at the section „[BASIC]“. It has the keys „amount“ and „random“. The value from „amount“ is per default 20, which means: When a player kills a zombie he will get 20 money.

 

The key „random“ is responsibly for the randomisation. The higher the number the less likely the player will receive money after he killed a zombie. Setting the value to zero will give the player the money after every kill, 100 and he will never get it, 50 on the other hand is a 50/50 chance.

 

Now on to the other sections. They work pretty much all the same, so I will only describe the „[WEAPONS]“ section. Each key is an item in the shop, the value (the part after the =) is the prize of it.

 

The key has to be the scriptname of the item, you can find those in „Steam\steamapps\common\ProjectZomboid\media\scripts“. Don´t forget the module (look at the top of the file). You can also add items from mods.

 

You can add as many items as you want.

 

Can I improve the mod?

Of course you can! The mod is available on Github, please feel free to extend the mod, just keep in mind to share the changes with everyone.

 

 

Changelog:

Spoiler

### Version 1.4.2
    - skills above 10 aren´t listed anymore

 

### Version 1.4.1
    - removed debug prints from ISCoxisShopPanelSkills
    - skillcosts are now rounded to whole numbers

 

### Version 1.4.0
    - skills are now definable in ini
    - skill "goldbonus" removed for now

 

### Version 1.3.0
    - bugfix: integrated LuaNet to get rid of the "all players earn money in MP"-bug
    - dialog informing the player that the settings aren´t loaded yet
    - bugfix: new character after player died in MP is fixed now (proper reinit)
    - definable shop key in the game options (thanks to blindcoder)
    - player starts now with 0 money instead of 100

 

### Version 1.2.0
    - definable settings within the "CoxisShopSettings.ini"
        - define the amount of money gained
        - define the randomness of money gain (not the amount is random, but you won´t get money after each zombie kill)
        - define the items available in the shop (with prize setting aswell)
    - now need the mod "CoxisUtils" to work ("CoxisUtils" reads the ini-file)
    - new section "food/drink"
    

### Version 1.1.0
    - support for dedicated server MP (Coop not working)

### Version 1.0.0
    - basic functionalitiy like the shop from challenge had
    - only SP

 

 

Link to Github)

DOWNLOAD

WORKSHOP

DOWNLOAD (CoxisUtil)

Edited by Dr_Cox1911
v1.4.2
Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the late reply.

 

Did you get any errors when testing it in MP? I´ve currently no testserver up&running but will setup one the next couple of days and give the mod in MP a go.

 

What I forgot to mention: This version has is still WIP, so to test things you can cheat money in with the "L" key.

Link to comment
Share on other sites

Sorry for not looking back at this sooner. I just finished the new version with dedicated multiplayer support. Servers hosted from the main game don´t work, sorry for that.

I didn´t test splitscreen either.

 

EDIT:

Just uploaded the mod to the steam workshop, but beware! If you download from github the debug-function to add money is activated (press "L"), downloaded from steam workshop and you won´t be able to debug it!

Edited by Dr_Cox1911
added to steam workshop
Link to comment
Share on other sites

Pushed a new version (only to git at the moment)

The debug flag is false for right now.

Changes:

Spoiler

### Version 1.2.0
    - definable settings within the "CoxisShopSettings.ini"
        - define the amount of money gained
        - define the randomness of money gain (not the amount is random, but you won´t get money after each zombie kill)
        - define the items available in the shop (with prize setting aswell)
    - now need the mod "CoxisUtils" to work ("CoxisUtils" reads the ini-file)
    - new section "food/drink"

 

I need some input from you guys, what items (and the according prizes) would you like to see in the default settings ini?

Of course you can alter this ini to your liking, but shipping with a decent one right of the bat would be necessary I think.

Edited by Dr_Cox1911
Link to comment
Share on other sites

Added the link to CoxisUtil to the first post.

Sorry for the additional mod that this is requiring now, but I think I will need the CoxisUtil for more of my mods in the future ;-)

 

@justcrow I will give detailed instructions on how to alter the settings in time, just need to write it. 

After I´m done writing I will update the Steam release as well.

 

As you guys might have noticed: The skills are still the same (=old system). Will migrate them to the new one for the next version, until then you won´t be able to define the skills available in the ini.

Link to comment
Share on other sites

6 minutes ago, Dr_Cox1911 said:

Added the link to CoxisUtil to the first post.

Sorry for the additional mod that this is requiring now, but I think I will need the CoxisUtil for more of my mods in the future ;-)

 

@justcrow I will give detailed instructions on how to alter the settings in time, just need to write it. 

After I´m done writing I will update the Steam release as well.

 

As you guys might have noticed: The skills are still the same (=old system). Will migrate them to the new one for the next version, until then you won´t be able to define the skills available in the ini.

 

oops! Sorry about that. I understood. Thank you Doc!

Edited by justcrow
Link to comment
Share on other sites

Just added in a short description on how to alter the settings (see the first post).

 

The skills will be defined pretty much the same as the items, I have this structure in mind:

[SKILLS]
Perks.Woodwork=600

I also plan on increasing the cost each level the player wants to buy, e.g. carpentry lvl 3 will cost more than lvl 2. This all is planned for 1.3.

Edited by Dr_Cox1911
Link to comment
Share on other sites

@Sky_Orc_Mm I just looked at this weird overflow issue you posted on discord.

Unfortunately I can´t seem to preproduce it, here is a screen of the shop on my end:

CoxisShop_CN.jpg

 

I tried altering the length and unless I stress it to extreme lengths it works on my end.

Will push this version to Steam workshop now after altering the default CoxisShopSettings.ini a bit, but will further investigate this error.

 

Is it OK with you to release the chinese translation to the workshop?

Link to comment
Share on other sites

Every player starts with 100 money (this value can´t be changed right now, will put this on the todo list for 1.3).

After death you will start again with 100 money.

 

All money you earned is lost when the player dies.

Edited by Dr_Cox1911
Link to comment
Share on other sites

13 minutes ago, Dr_Cox1911 said:

Every player starts with 100 money (this value can´t be changed right now, will put this on the todo list for 1.3).

After death you will start again with 100 money.

 

All money you earned is lost when the player dies.

 

Thank you for a quick answer. Well, getting with 100 makes a easy start, I think.  In MP, users can buy 100-money valued items(if there are in the server)and die on purpose to do the same thing or they can make lots of accounts to do the same thing. For example If the 9mmbullets are 100 in the server, 5times death on purpose gives them lots of bullets from start. Before death, they could drop the items that they bought with 100 and repeat. Starting with 0 must be done as soon as possible :) 

Edited by justcrow
Link to comment
Share on other sites

Red box pops up whenever pressing "O" key. Yesterday it happened for a while and then it worked after a few minutes. But following day, the red box happened again pressing "O" key.

 

Here is console message. Any problem?

 

 

attempted index: setEnable of non-table: null
-----------------------------------------
STACK TRACE
-----------------------------------------
function: reloadButtons -- file: ISCoxisShopPanel.lua line # 137
function: reloadButtons -- file: ISCoxisShop.lua line # 69
function: showUpgradeScreen -- file: CoxisShop.lua line # 58
function: onKeyPressed -- file: CoxisShop.lua line # 94
java.lang.RuntimeException: attempted index: setEnable of non-table: null
 at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1549)
 at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:623)
 at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
 at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1727)
 at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1672)
 at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:53)
 at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:81)
 at zombie.Lua.Event.trigger(Event.java:37)
 at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:83)
 at zombie.input.GameKeyboard.update(GameKeyboard.java:48)
 at zombie.GameWindow.logic(GameWindow.java:571)
 at zombie.GameWindow.run(GameWindow.java:1233)
 at zombie.GameWindow.maina(GameWindow.java:1015)
 at zombie.gameStates.MainScreenState.main(MainScreenState.java:177)
-----------------------------------------
STACK TRACE
-----------------------------------------
function: reloadButtons -- file: ISCoxisShopPanel.lua line # 137
function: reloadButtons -- file: ISCoxisShop.lua line # 69
function: showUpgradeScreen -- file: CoxisShop.lua line # 58
function: onKeyPressed -- file: CoxisShop.lua line # 94
 

Edited by justcrow
Link to comment
Share on other sites

@justcrow Is the shop window working for anybody? Any errors on the server side?

If there are no errors on the server than the players are pressing "o" to quickly after joining the server. It takes a short while to receive the settings.

 

Could you check the server for any errors and tell the players with problems to wait a minute after joining before opening the shop?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...