Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
50 finally had some time and motivation to work on my rp tracker project again.

It now should have a very crude way for actions to add modifiers. and with crude I mean remove all the current ones and add them back in 1 by one. I haven't properly tested this yet, but after running an action that did nothing there where still modifiers left. (and that code runs regardless if the action did something.)
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
51 Add page, but only adds things once? Are you using static length lists or something that modifying them requires a full removal and start over?
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
52 an action is just some lua code that is made by the user and they can do all kinds of things like spawn new characters into the battle, add or remove modifiers, remove characters from battles, change locations of characters and maybe more I haven't thought of yet/forgot.

At the end of running an action I need to update the database to actually store these changes.
There are 2 ways to do this, the efficient one, being to first calculate the changes and update the database accordingly or the easy one which is to throw the old data away and start over.

For now, I am going for the easy route, and doing so in the easiest way. If it turns out to become a bottleneck I can always improve upon it.

Also, going with the remove everything and start over way could allow me to run the updates with just 2 calls to the database per character. (1 to remove and 1 to add everything back). Something that isn't easy to do when updating only the changes. (and yes, I said could as right now I use 1 database call for each modifier that needs to be added. Like I said, its a crude method right now)

And yes, I realize that I can add helper methods to the lua code that access the database so it gets updated while the lua code runs, but then you need to deal with people who think its fun to write code like
Code:
while true do
    getAllCharactersInRP()
end
which does nothing more but bombard my database with requests, because people find doing that stuff fun......

Of course, I could make them more complicated so they don't directly make requests to the database unless it can't be avoided, but then I am back to the first problem.

TL,DR: Currently in the process to just make it work as it can always be improved later on if it ends up being needed.
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
52. I did manage to play Starcraft II: Heart of the Swarm for the first time last night. And came to the conclusion that I'd forgotten just how much of a massive noob I am...
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
51 and... I fixed a major bug in my school project.
The bug was that the dungeon wouldn't reset properly when going to the next level. The problem being: python being stupid >_<
The offending code was something like
Code:
class Maze:
    grid = {}
    exitPath = {(0,0)=False}
And if you don't know python, this may not ring a bell as being wrong (at least, not as something that could cause a dungeon to not reset properly, even if you throw the maze object away.)

If you do know python, you may realize that writing variables that way is actually making static properties instead of non-static one like it would do in 99.999999% of other languages.
So... I moved them to the constructor method and now it works :)

And people ask why I don't like python:rolleyes:.... (though, to be honest. There aren't many languages I like. I guess Lua-script is on that list but there are plenty of things I don't like about that either and that one has a massive advantage as it is the first language I learned.)
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
50 It snowed, but my school is ready for it. Uni has bobcats with snowplows on them to clear walking paths.
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
49. Southwest England very rarely gets snow, but its not usually a sign of the End Times when it does. Up in Stoke-on-Trent, there was usually at least one heavy (for England) snowfall every year. Driving in that is fun :p
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
49. Nice one!

My friend is now back from Germany, so I get to find out how his holiday went, and whether the long-burning feelings for the lady he went to visit (which were finally admitted to her earlier this year, and found to be mutual) have at long last actually developed into something.

Seriously though you guys, these two... I knew he liked her before HE did, and I had a strong feeling she felt the same, but they never admitted it while doing their PhD's together, she even moved to another country for post-doc work, and finally finally they are honest with each other - and have now holidayed together. We shall see...
 

triggerfinger12

Well-Known Member
Apr 17, 2017
255
457
89
Rock
50. Well, I can't say that I like anyone at this time, not that its a bad thing to be single. I like that I don't have any extra baggage...