Hybridd Posted September 1, 2014 Share Posted September 1, 2014 i need to add some crimes to my game but dont know where to start with the formula so any help would be much appreciated :) Quote Link to comment Share on other sites More sharing options...
Hybridd Posted September 1, 2014 Author Share Posted September 1, 2014 i get an error when i try adding a crime: QUERY ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' 0, '', 'test', 'test', 'test', 'test', 1, 'test', 2)' at line 1 Query was INSERT INTO crimes (crimeNAME, crimeBRAVE, crimePERCFORM, crimeSUCCESSMUNY, crimeSUCCESSCRYS, crimeSUCCESSITEM, crimeGROUP, crimeITEXT, crimeSTEXT, crimeFTEXT, crimeJTEXT, crimeJAILTIME, crimeJREASON, crimeXP) VALUES( 'test', '1', '((WILL*0.8)/2.5)+(LEVEL/4)', '13', , 0, '', 'test', 'test', 'test', 'test', 1, 'test', 2) Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 1, 2014 Share Posted September 1, 2014 (edited) A simple calculator would help quite a bit if you wanted to keep the same type of formula. I dont know the exact formula off the top of my head by default but it's something like: ((WILL*0.8)/3)+(LEVEL/4) Now let's look at some scenarios here with a low and high level player: Player 1 LEVEL: 1 WILL: 100 ((100*0.8)/3)+(1/4) = ~26 Now that's pretty tough for a low level player so for starter crimes it's not bad but what if we use the same formula for a more advanced player: Player 2 LEVEL: 20 WILL: 500 ((500*0.8)/3)+(20/4) = 138 That would be a successful attempt every single time because all results are in % and the crimes do a random number between 1-100, if it's the success result is > random number ? win : lose if you start lowering that 0.8 a bit that will help lower the chance of success pretty. So just mess around with the numbers and you can use other stats as well like IQ or Labor since a lot of people don't even mess with those that much either lol. Edit as as for your error try removing your '' where you have an int field in the database. You really only need those for strings and will sometimes kick an error. Edited September 1, 2014 by KyleMassacre Quote Link to comment Share on other sites More sharing options...
SRB Posted September 1, 2014 Share Posted September 1, 2014 Wrong point Kyle. Look between the 13 and 0 - MySQL won't ever accept that empty field. Encase that one with quotes and it'll be solved Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 1, 2014 Share Posted September 1, 2014 Wrong point Kyle. Look between the 13 and 0 - MySQL won't ever accept that empty field. Encase that one with quotes and it'll be solved DOH!!! Good eye :o Maybe I should look at the entire error dump Quote Link to comment Share on other sites More sharing options...
SRB Posted September 1, 2014 Share Posted September 1, 2014 Furthermore, I'm guessing that means he's trying to add crimes before crime groups, since that's what it fails on Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 1, 2014 Share Posted September 1, 2014 My count shows crystals and a blank crime group Quote Link to comment Share on other sites More sharing options...
SRB Posted September 1, 2014 Share Posted September 1, 2014 Indeed it it. Clearly the ternary is wrong : false ; To : 0 ; Or similar Quote Link to comment Share on other sites More sharing options...
Hybridd Posted September 2, 2014 Author Share Posted September 2, 2014 thanks a lot kyle, that worked :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.