Wgrpg

Yeah, just ran into that.
Replacing $intWeightGain with floatval($intWeightGain) on the 1289th line of RPGCharacter.php seems to have worked. Or well, it stopped it from throwing an error-

1 Like

Yeah, after tracing how it calculates weight gain after defeat that’s the simplest fix. I haven’t run into any other errors yet, so the dungeon part seems to be working fine now. Haven’t tried anything else.

I can’t buy items it just says " Error: Invalid size specified for this item. " . Don’t know what to do.

In shoptransactionbuy.php, remove/comment out lines 22 and 24-27. I didn’t test this very much so it might break something else, but the shop should work.

Also, in DataGameUI.php, surround lines 80-84 with an if like this:

if($_SESSION['objRPGCharacter']->getCombat() != null) {
		if($_SESSION['objRPGCharacter']->getCombat()["EnemyTeam"] != null && !isset($_SESSION['objCombat'])){
			$_SESSION['objCombat'] = new RPGCombat($_SESSION['objRPGCharacter']->getParty(), $_SESSION['objRPGCharacter']->getCombat()["EnemyTeam"], $_SESSION['objRPGCharacter']->getCombat()["FirstTurn"]);
			$_SESSION['objCombat']->initiateCombat();
			$_SESSION['objRPGCharacter']->setStateID($arrStateValues['Combat']);
		}
	}

That’ll get rid of the warning at the top of the page.

1 Like

Now its says Error: You don’t have enough gold for this purchase. xD

Assuming you have enough gold, double check that you didn’t make any other changes. If you’re not sure you can redownload that file from the GitHub and redo it.

Double checked, still says that even if i have the gold.

Here’s what that block should look like. If you made any other changes to that file except this then that might be why.

$intPurchasePrice += $_POST['price'][$i] * $_POST['quantity'][$i];
$tmpItem = new RPGItem($_POST['itemID'][$i]);
//if(isset($_POST['size'][$i]) && in_array($_POST['size'][$i], $arrClothingSizes)){
	$tmpItem->setSize($_POST['size'][$i]);
//}
//else{
//	$_SESSION['strShopError'] = '<b>Error:</b> Invalid size specified for this item.';
//}
$tmpItem->setQuantity($_POST['quantity'][$i]);
$arrItemsPurchased[] = $tmpItem;

Alright, I can get to the character creation screen and when i submit the character it always gives me this error,
Fatal error : Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘dbwgrpg.tblpartymember’ doesn’t exist in C:\xampp\htdocs\wgrpg\Database.php:20 Stack trace: #0 C:\xampp\htdocs\wgrpg\Database.php(20): PDO->query(‘SELECT strParty…’) #1 C:\xampp\htdocs\wgrpg\RPGCharacter.php(506): Database->query(‘SELECT strParty…’) #2 C:\xampp\htdocs\wgrpg\RPGCharacter.php(198): RPGCharacter->loadPartyMembers() #3 C:\xampp\htdocs\wgrpg\RPGCharacter.php(253): RPGCharacter->loadRPGCharacterInfo(‘204’, true, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’) #4 C:\xampp\htdocs\wgrpg\createCharacter.php(59): RPGCharacter->createNewCharacter(‘Jimb0kit0’, ‘t’, ‘108’, 152, ‘Female’, ‘Heterosexual’, ‘Shy’, ‘1’, ‘1’, ‘Brown’, ‘Short’, ‘Brown’, ‘White’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’) #5 {main} thrown in C:\xampp\htdocs\wgrpg\Database.php on line 20
but when i back out of this, my character saves and when i load the character it does this,
Fatal error : Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘dbwgrpg.tblpartymember’ doesn’t exist in C:\xampp\htdocs\wgrpg\Database.php:20 Stack trace: #0 C:\xampp\htdocs\wgrpg\Database.php(20): PDO->query(‘SELECT strParty…’) #1 C:\xampp\htdocs\wgrpg\RPGCharacter.php(506): Database->query(‘SELECT strParty…’) #2 C:\xampp\htdocs\wgrpg\RPGCharacter.php(198): RPGCharacter->loadPartyMembers() #3 C:\xampp\htdocs\wgrpg\RPGCharacter.php(88): RPGCharacter->loadRPGCharacterInfo(‘204’) #4 C:\xampp\htdocs\wgrpg\character.php(18): RPGCharacter->__construct(‘204’) #5 {main} thrown in C:\xampp\htdocs\wgrpg\Database.php on line 20

Can someone please help me?

Best quick guess is the database didn’t import correctly. I’ll try to take a closer look over the weekend if I can, in the meantime try dropping dbwgrpg then recreating and reimporting it. These links might be helpful.

Did you find out what I need to fix? I can’t figure it out

Is anyone else doing any sort of modifications to the game? I personally have been working on a 5th floor, as well as a functional gym for improving stats.

1 Like

I haven’t, my assumption is that something either went wrong somewhere when you were setting it up, or somewhere when you were manually changing the files. Try starting over and paying close attention to the database import.

As far as mods, I’ve toyed with the idea, I’d like to port it to something more maintainable and extensible, with support for easily dropping in mods for things like events. I think that would be a good solution for crowdsourcing without the issues of having a singular gatekeeper with creative control vs. splintered versions at various stages of development. The main roadblock, for me, is that Cryptic hasn’t explicitly given permission for something like that, and there’s no license on the repo. That’s also why I’ve been posting where to make modifications instead of posting the modified files, I don’t want to run into any (admittedly unlikely) legal issues. If Cryptic adds a license to the repo, that’s something I’d consider doing.

I don’t know how to add a license to the repository, but I’ll reiterate that people are free to mod the source code however they see fit. I wouldn’t even know how to take legal action for that, assuming I did care enough to, but I don’t, so there’s nothing to worry about. I’m actually just flattered that people put in the effort to run my game offline, let alone try to mod it.

2 Likes

honestly a video for this would be well appreciated, I’m not very good at things without seeing a demonstration.

It’s actually really simple. It sounds like you just want to make it public domain, so “Unlicense” is what you would pick. Either way, I’ll take you at your word on that, it was mostly just a matter of now wanting to tear apart and rebuild somebody else’s project without verifying that they were cool with it.

Thanks, I’ve added the Unlicense license to the repository.

2 Likes

Thanks. I forked it, committed the fixes from this thread, and updated the README with a guide to setting it up, with screenshots this time. Hopefully that’ll help anybody who was having trouble.

3 Likes

i followed the instructions on the readme and it lead me to a paradox because i kept going to that specfic zip and it just took me right back to the same one as the readme.

Is there a way to download it from not Github? because i have an error when trying to do such. Or its ok?