Ayern Posted May 14, 2014 Author Share Posted May 14, 2014 I see some say they played it. I'm new at this so is there a way to play it? http://www.simplerts.netai.net click that url. there's a register button on the left side. do that and login and poke around :) Quote Link to comment Share on other sites More sharing options...
Tangled Posted May 14, 2014 Share Posted May 14, 2014 ok wow easy game. Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 14, 2014 Author Share Posted May 14, 2014 ok wow easy game. Just now finished a bunch of re-balancing of rewards and costs for the Grinding and Tavern sections on demo. Need some testers to level up. Feedback if at all possible so i can get on releasing it as well. Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 17, 2014 Author Share Posted May 17, 2014 Even more updates and re-balancing on the entire engine to make room for quests and mobs. It seems including grinding has broadened my range of what I thought game engines were capable of. On another note... 500+ lines of code and a lot of if statements, I was wondering if anyone could help me with passing variables through functions as parameters? I've tried a few different ways but can't seem to get the right result. for instance I want to check if experience is greater than or equal to the maximum value stated in the if statement that would contain the function. i have tried $stats['experience'] >= $experience_needed is the in basic if statement with mysql update and then displays a button in html below. I would like a function to do this. needtolevel($stats['experience'],$experience_needed); function needtolevel($exp,$exp_needed){ if($exp >= $exp_needed) { reward("You now have enough Experience to increase your Adventurer's Level!"); } } also would display a button to level up. I really would like to know what i'm doing wrong.. anyone have tips for this? Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 18, 2014 Share Posted May 18, 2014 You can try something like this echo needtolevel($stats['experience'],$experience_needed); function needtolevel($exp,$exp_needed){ if($exp >= $exp_needed) echo reward("You now have enough Experience to increase your Adventurer's Level! <br />Click <a href='somepage.php'>Here</a> to level up"); } I'm not too sure on your reward() function if it returns or echos/prints. And also sorry if this isn't what you were looking for, maybe I read your post wrong since I'm a bit confused Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 18, 2014 Author Share Posted May 18, 2014 I suppose just leaving it hard-coded is fine still, I don't need the function but thought it might make things run smoother. Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 18, 2014 Share Posted May 18, 2014 /** * Some description of the function. * @param int $exp - Some description. * @param int $exp_needed - Some description. * @return int - 1 => Exp greater than or equal. 2 => Not greater than or equal to. */ function needToLevel($exp,$exp_needed){ if($exp >= $exp_needed) { return 1; } else { return 2; } } I commented function, just add the description this help developers use the function too. Like [MENTION=68711]KyleMassacre[/MENTION] said, we don't know the contents of reward(); either so that might be the issue. Then maybe to something like this: if(needToLevel($param1, $param2) == 1) { // Reward message. } Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 18, 2014 Author Share Posted May 18, 2014 /** * Some description of the function. * @param int $exp - Some description. * @param int $exp_needed - Some description. * @return int - 1 => Exp greater than or equal. 2 => Not greater than or equal to. */ function needToLevel($exp,$exp_needed){ if($exp >= $exp_needed) { return 1; } else { return 2; } } I commented function, just add the description this help developers use the function too. Like [MENTION=68711]KyleMassacre[/MENTION] said, we don't know the contents of reward(); either so that might be the issue. Then maybe to something like this: if(needToLevel($param1, $param2) == 1) { // Reward message. } This is reward(); function reward($string) { echo "<div id=\"reward\">" . $string . "</div>"; } Nothin special. i havent tried == 1 yet, but ive been getting a false even when passing variables that should come out true. Quote Link to comment Share on other sites More sharing options...
Script47 Posted May 18, 2014 Share Posted May 18, 2014 This is reward(); function reward($string) { echo "<div id=\"reward\">" . $string . "</div>"; } Nothin special. i havent tried == 1 yet, but ive been getting a false even when passing variables that should come out true. Return 1 just allows your to know if it is greater than it. You could easily do return TRUE or return FALSE. Either way it just preference. Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 18, 2014 Author Share Posted May 18, 2014 Well see i'd put some if logic like that into a function and if true it should call reward("You can level up now"); if false do nothing. }else{ do nothing. which, but I would still keep getting a false and it will call the next { which has reward(); even if exp ISNT greater than exp_needed Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 18, 2014 Share Posted May 18, 2014 What does your stats array return? Because if you know for a fact that it should be greater then possibly it's return 0? Maybe in the script where your are using the function try dumping your $stats. I also discovered a fancy little debug too here: http://raveren.github.io/kint/ Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 19, 2014 Author Share Posted May 19, 2014 You're correct Kyle it was returning 0 and I wasn't using the function right. I was trying to use it as in-line code instead of using its result of the comparison. Added materials/resources to find :) Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted May 19, 2014 Share Posted May 19, 2014 You're correct Kyle it was returning 0 Yeah I know :p j/k Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 29, 2014 Author Share Posted May 29, 2014 the grinding functionality has evolved into "classes" and Grinder is one of them. Skinner, Leatherworker, Miner, Smelter and more classes to level up and each perform specific functions in relation to each other and the game mechanics of fighting other players in pvp. The live version will no longer receive updates as I cannot rely on the free servers for up-time in addition to my dsl wifi connection so im using WAMP server and i've dramatically increased development speed. I forgot the only reason I signed up and started using the online servers was to test crons, and they worked but i dont need crons anymore for development purposes. So, in light you can play the demo version of the engine 0.5 alpha and I will be continuing coding throughout my mundane daily life of being a house dad. If you would like an update you can PM me on here and ill update the files to whatever current stable version for testing. When i'm satisfied with all the different aspects of the engine and what it lays out for any generic game I will probably release that version stripped of all db relations and just have similar generic names for distribution.. Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 30, 2014 Author Share Posted May 30, 2014 the grinding functionality has evolved into "classes" and Grinder is one of them. Skinner, Leatherworker, Miner, Smelter and more classes to level up and each perform specific functions in relation to each other and the game mechanics of fighting other players in pvp. Here's a look at some changes to the game... [ATTACH=CONFIG]1538[/ATTACH] Quote Link to comment Share on other sites More sharing options...
sniko Posted May 30, 2014 Share Posted May 30, 2014 Here's a look at some changes to the game... [ATTACH=CONFIG]1538[/ATTACH] What's with the uppercase/lowercase wording? Quote Link to comment Share on other sites More sharing options...
Ayern Posted May 30, 2014 Author Share Posted May 30, 2014 What's with the uppercase/lowercase wording? I...felt like it. That's all you had to say? :( lol Quote Link to comment Share on other sites More sharing options...
gamble Posted May 30, 2014 Share Posted May 30, 2014 I...felt like it. That's all you had to say? :( lol Id change that ASAP...looks terrible 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.