MakeWebGames

# need help with crimes formula..

## Recommended Posts

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 :)

##### Share on other sites

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)

##### Share on other sites

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 by KyleMassacre
##### Share on other sites

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

##### Share on other sites

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

##### Share on other sites

Furthermore, I'm guessing that means he's trying to add crimes before crime groups, since that's what it fails on

##### Share on other sites

My count shows crystals and a blank crime group

##### Share on other sites

Indeed it it.

Clearly the ternary is wrong

: false ;

To

: 0 ;

Or similar

##### Share on other sites

thanks a lot kyle, that worked :)

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

• #### Marketplace

• Discord Chat
• PBBG Directory
×
• Create New...