Dodging_Rain wrote:My apologies ahead of time but I need to make some more bug reports. Current version .11
Attempting to use the arrows in the build > mine/turret interface will cause this error.
Another error of compatibility, but you can repair it from Options > Debug GUI, but now if you change version, allways reload GUI.
This is done in version 0.0.12 and a minor problem with MP.
Dodging_Rain wrote:Finally, this one is relatively minor. When using the Foreman's Blueprint Manager mod] and the Time speed button mod. The Time speed button is gone. I am not sure if it is due to UI issues or limits.
I'm not sure, now i'll test it, I always use Time speed, sometimes her gui is disappears, but if set your mouse in top-left corner of screen, it reappear again.
Dodging_Rain wrote:
L0771 wrote:
Dodging_Rain wrote:Seems that mining skill also counts removing buildings and structure for their bonus. Meaning that you can duplicate items by constantly removing and placing items down repeatedly.
It only can be possible if that building is a resource
Strangely I was unable to duplicate fore-mentioned bug again, though I will see if I can do it again later. Something to note is that you can "craft" cursed tree seed by manually planting it and then farming it immediately, giving you farming xp and a chance to duplicate it through the system.
The mining problem maybe is before version 0.0.10 if you mine a resource, mine a building and click in Mining stat, this change shows the last exp gained for resource mined.
The problem with the trees is a very big problem, i'll talk with TreeFarm's owner for this, but obviously is my problem, i want Cursed Exp with 100% compatibility with ALL mods.
Thanks for report all problems, it is very helpful.
Re: [MOD 0.11.5] Cursed Exp - v0.0.11
Posted: Fri Dec 12, 2014 3:46 am
by Roricorn
Stop forgetting to add lines of code in "onplayermineditem" and "onentitydied" every time you create new building, which handled every N ticks. Removing/destroying Cursed Bank/vault leads to error.
Also, removing every gun and all ammo in your gun "toolbar" is kinda not fun.
Anyway, great job at maintainig your mod.
Re: [MOD 0.11.5] Cursed Exp - v0.0.11
Posted: Fri Dec 12, 2014 5:57 am
by L0771
Roricorn wrote:Stop forgetting to add lines of code in "onplayermineditem" and "onentitydied" every time you create new building, which handled every N ticks. Removing/destroying Cursed Bank/vault leads to error.
Also, removing every gun and all ammo in your gun "toolbar" is kinda not fun.
Anyway, great job at maintainig your mod.
Ok i forget delete property mineable, now it work... But if you destroy the vault with scrapmod, can duple items, fixed this to
Ok, weapons is not removed anymore, i don't need it now.
The only big problem is the farm trees, but i can't do it now.
[s]Now i'll work in version 0.11.6[/s] (Whatever, quiero tachar esto)
Re: [MOD 0.11.5] Cursed Exp - v0.0.11
Posted: Fri Dec 12, 2014 7:16 am
by n9103
How about putting something like this in as an explicit fix? (less than optimal, implicit references being preferred for flexibility)
Because i need compatibility with all mods, mature dytech's tree is "mature-rubber-tree" and my mature tree is "cursed-tree-04" and others like Caffein-Addon and AlienPlant.
I need create an inverface for TreeFarm where returns true or false if is the last state of
glob.treefarm.seedTypes[seedInfo.name].states
I do it tomorrow and present to drs9999.
I think it is the most optimiced version
Thanks for help
Update
v0.0.12
- Now weapons are no deleted.
- Fixed more compatibility problems
- Now if you level up a stat, the talent gained is updated in gui
- Fixed compatibility with scrapmod
- Fixed problems with experience refresh for general stats
- Fixed bonus defense on gui
- Now if someone connects to MP, don't reload gui for all players
- Now can see HP of mines and turrets in Builds (Update every 5 seconds)
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Fri Dec 12, 2014 8:16 am
by n9103
ah, thought it was specifically a treefarm problem.
Well, can still go with my explicit check, just expanded to these new types.
Still sloppy, i know. Consider this another weight on my 'time to fully learn Lua' scale.
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Fri Dec 12, 2014 8:22 am
by L0771
n9103 wrote:ah, thought it was specifically a treefarm problem.
Well, can still go with my explicit check, just expanded to these new types.
Still sloppy, i know. Consider this another weight on my 'time to fully learn Lua' scale.
Is my problem by use the treefarm
Is lua used in "real life"? I was started to learn with this mod.
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Fri Dec 12, 2014 8:51 am
by drs9999
L0771 wrote:
n9103 wrote:ah, thought it was specifically a treefarm problem.
Well, can still go with my explicit check, just expanded to these new types.
Still sloppy, i know. Consider this another weight on my 'time to fully learn Lua' scale.
Is my problem by use the treefarm
Is lua used in "real life"? I was started to learn with this mod.
I would be glad to help, but after reading it three times I still don't understand the problem or what it has do with treefarm...
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Fri Dec 12, 2014 9:36 am
by L0771
drs9999 wrote:
L0771 wrote:Is my problem by use the treefarm
I would be glad to help, but after reading it three times I still don't understand the problem or what it has do with treefarm...
We here (in my town) say "if you do nothing, nothing goes wrong" --> "if i don't do this mod, would not have bugs"
You answered before than expected (drs9999 read my post, i'm happy *-* I use your mods since I started )
Ontopic, in my mod, you earn experience each resource mined, each meter walked, each tree cutted.
Now i have a problem if i plant a tree and cut this, i earn experience; with this if i plant and cut the same tree, can farm experience and items.
To do this, I need a interface in TreeFarm to know if the tree is the last state, and only last state gain experience and other bonuses.
I think with a interface like this can work, i don't tested, i wrote this just now.
getTreeState = function(tree)
local seedTypes = glob.treefarm.seedTypes
for k, v in pairs(seedTypes) do
for i = 1, #v.states do
if v.states[i] == tree.name then
return {state = i, total = #v.states}
end
end
end
end,
I'm new here, maybe this is wrong :/
Thanks for help, and sorry for taking so long, i wrote all by translate... My english is bad.
EDIT: It work, but i don't know if can optimize.
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Fri Dec 12, 2014 11:11 am
by drs9999
Ah ok, got it.
I haven't tested it, but I doubt that calling interfaces frequently is a good idea performance-wise.
However what I could do is adding an interface that returns the complete seedTypes-table.
You could call it just once a game is started or loaded and parse the table for the needed information, in this case the last growingstage for each plant.
I like the idea, because it's very universal. E.g. you also have access to the growingTime, so you could make the experience gain depending on it.
If you want to test it (actually it's a no-brainer ):
if (remote.interfaces.treefarm) and (remote.interfaces.treefarm.readData) then
...
end
I call it on oninit and a option check in options.
And with this i can give a % of exp if state is > 1.
It this optimized?
n9103 wrote:OH, my bad.
I thought the problem was tree farms harvesting trees was generating experience.
I'll just shut up and go back to lurking the thread now.
What? If you are very helpful Really
Dodging_Rain wrote:Is there a remote call to force the gui to appear? One of my save doesn't seem to show the cursed exp gui even when I save and reload.
No, because i don't know who has called the interface, and i can't reset all guis in a remote.call
I'm sorry, i've broken this on my last "optimization", more than 100 lines unused, but i forget this problem, i can "ask" if the interface is showing on load, for the next update.
Thanks for report it.
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Sat Dec 13, 2014 3:43 am
by oktabyte
It seems that this mod sometimes causes desynchs in multiplayer and replay...
In multiplayer (2player), if the host (game.players[1])has the gui open for skills and that gets updated (exp, seen mainly with crafting during crafting), it sometimes causes desync. In replay i cannot tell (don't have time to watch 45 minutes over and over just to see what exactly causes it...)
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Sat Dec 13, 2014 4:21 am
by L0771
oktabyte wrote:It seems that this mod sometimes causes desynchs in multiplayer and replay...
In multiplayer (2player), if the host (game.players[1])has the gui open for skills and that gets updated (exp, seen mainly with crafting during crafting), it sometimes causes desync. In replay i cannot tell (don't have time to watch 45 minutes over and over just to see what exactly causes it...)
Ok, i'll work on this now.
And isn't necesary a big report, i only want to know what happen, the code is very simple, but i can't review all code every update.
Thanks for report.
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Sat Dec 13, 2014 6:33 am
by drs9999
L0771 wrote:Ok, thanks you, with this name (readData)? I implement this for my next update
Code: Select all
if (remote.interfaces.treefarm) and (remote.interfaces.treefarm.readData) then
...
end
I call it on oninit and a option check in options.
And with this i can give a % of exp if state is > 1.
It this optimized?
I'm going to name it "GetSeedTypesData", probably. And release it tomorrow.
I would also call it in the OnLoad-event, because OnInit is just called once (when a new game is started).
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Sat Dec 13, 2014 10:28 am
by oktabyte
Found a crashbug: when sharing a map (send save + mods folder to friend, he tries to start gets the message) with a friend the map said
Error while runnung the event handler:
Curse-Exp \control.lua:659: attempt to
index field "?" (a nil value)
During loading of the map.
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Sat Dec 13, 2014 3:55 pm
by L0771
oktabyte wrote:Found a crashbug: when sharing a map (send save + mods folder to friend, he tries to start gets the message) with a friend the map said
Error while runnung the event handler:
Curse-Exp \control.lua:659: attempt to
index field "?" (a nil value)
During loading of the map.
Your friend must have a Username, if he want all your stats use the same nick (it is a problem on multiplayer too, but is a factorio problem, not a bug, but can login 2 players with the same nick). If he play with other nick, no problem, it is like multiplayer (but with only 1 player), if he load the game with other nick, the mod automatically sets new variables, but if he haven't a nick, this variables set to "", and this give a error when i want read it.
For now, this only crashes and show a message, i don't know how to kick of multiplayer game and how to know if it is multiplayer game :p
if v.name == "" then
globalPrint("Use a nick in Options > Others > Multiplayer Username, now crash :(")
v.insert({name = "cursed-tree-00",count = 0})
end
I finished v0.0.13 last night but i'll post when drs9999 published his update
The problem with the gui happen sometimes, i can't test, but i think it is solved...
And now can use /c remote.call("cursed","resetgui") if any player calls this interface, resets all brokens guis.
function refreshTrees()
if remote.interfaces.treefarm and remote.interfaces.treefarm.getSeedTypesData then
local trees = remote.call("treefarm", "getSeedTypesData")
local arboles = {}
for _,v in pairs(trees) do
if #v.states > 1 then
for i = 1, #v.states do
arboles[v.states[i]] = {state = i, total = #v.states}
end
end
end
local entityprototypes = game.entityprototypes
for _,v in pairs(entityprototypes) do
if v.type == "tree" then
if not arboles[v.name] then
arboles[v.name] = {state = 0}
end
end
end
else
local entityprototypes = game.entityprototypes
for _,v in pairs(entityprototypes) do
if v.type == "tree" then
if not arboles[v.name] then
arboles[v.name] = {state = -1}
end
end
end
end
glob.cursed.others.trees = arboles
end
Basically set a state to every tree(if treefarm is outdated, this set state -1), and it only refresh in oninit function and when "premine" a tree, like this
if event.entity.type == "tree" then
local trees = glob.cursed.others.trees
if not trees[event.entity.name] then
refreshTrees()
end
local percent
if trees[event.entity.name].state == 0 then
percent = 1
elseif trees[event.entity.name].state == -1 then
percent = 0.1
else
percent = (trees[event.entity.name].state - 1) / (trees[event.entity.name].total - 1)
end
-- More code, giving exp and bonus...
end
I thinks it is very VERY optimized, only 1 time for every map created, and if cut a "new" tree, but the problem is if any want to change a state, this maintain the old state, but i think change a state can't be possible and only with only one "new" tree all table is reseted.
I think it can work.
EDIT: If it version works fine, this is the last version of 0.0.x
Re: [MOD 0.11.5] Cursed Exp - v0.0.12
Posted: Sun Dec 14, 2014 8:26 am
by drs9999
L0771 wrote:
I finished v0.0.13 last night but i'll post when drs9999 published his update
Done
Re: [MOD 0.11.6] Cursed Exp - v0.0.13
Posted: Sun Dec 14, 2014 12:40 pm
by L0771
drs9999 wrote:Done
Thanks you.
Update
v0.0.13
- Now need TreeFarm version 1.2.6 or above
- Fixes problem with inmature trees , now the inmature trees gives a percent of total exp
- Fixes problem if gui don't show after load
- Fixes problems all with sandbox (but it isn't funny)
- Fixes some possibles crash
- Now if any tries to login without nick the game crashes
This is the last release for 0.0.x, in the next i add Cursed Tombs (a mini mod untested) with an adaptation for single player (can revive, but one does not simply die and revive), this is programed in my cellphone for now ... And maybe add the wall, I was thinking in a big change of walls ( )
I have an exam on Wednesday, and after that, i back here