Jump to content
InverTed

Knights of Lyroth

Recommended Posts

I love seeing all these updates, I might need to create a post like this. *You given me motivation*

  • Like 1

Share this post


Link to post
Share on other sites

Im glad this motivates you. Honestly id like to see more people do it this way. Even if you dont ever poke into the game youll still be up to date. Builds the hype 🙂

  • Like 1

Share this post


Link to post
Share on other sites
21 hours ago, InverTed said:

Honestly id like to see more people do it this way. Even if you dont ever poke into the game youll still be up to date. Builds the hype 🙂

It does. Sometimes real life just takes away from development of your living isn't coming from it.

Share this post


Link to post
Share on other sites

If i was to count hourly work between rl and my coding, to say i work 80 hours is likely an understatement. Im dedicating a lot of time i dont have to build something that i hope many will get to enjoy. The more eyes i have on the project now, the more likely i am to successfully push through, i use it as a motivator 🙂

  • Like 1

Share this post


Link to post
Share on other sites

So during the process of building the guild vault feature... I figured out that I now must re-code the entire inventory page. A slight step back but it'll be even better once I'm done with it. After the guild vault and inventory features are at 100% I will be turning my direction entirely towards content. Then after that the plan is to turn to the graphics. As I weigh the amount of work I want in before beta, you guys will all see the beta launch by early december or at the beginning of 2021. Potentially sooner if real life doesn't pull me away too much! 

Share this post


Link to post
Share on other sites

Okay so let me start this by I know the line of code I'm showing you will not work, I'm simply using it to reference what I'm going for and hopefully someone here can give me an idea.

$this->db->query("UPDATE character_list SET ? = ? WHERE userid = ?");

So basically what I'm going for is, I want to be able to dynamically change what is being set when this particular function is running. I want this one SQL statement to be able to handle several purposes. This is for equipping gear, so the first ? in the statement is obviously what gear slot I want altered. Any ideas? 

Share this post


Link to post
Share on other sites
13 hours ago, InverTed said:

Okay so let me start this by I know the line of code I'm showing you will not work, I'm simply using it to reference what I'm going for and hopefully someone here can give me an idea.

$this->db->query("UPDATE character_list SET ? = ? WHERE userid = ?");

$this->db->query("UPDATE character_list SET ? = ? WHERE userid = ?");

So basically what I'm going for is, I want to be able to dynamically change what is being set when this particular function is running. I want this one SQL statement to be able to handle several purposes. This is for equipping gear, so the first ? in the statement is obviously what gear slot I want altered. Any ideas? 

if($item_equip_area === 'head') {
    $col = 'equip_head';
} elseif($item_equip_area === 'shoulder') {
    $col = 'equip_shoulders';
} elseif($item_equip_area === 'knee') {
    $col = 'equip_knees';
} else {
    $col = 'equip_toes';
}
$this->db->query('UPDATE character_list SET '.$col.' = ? WHERE userid = ?');

 

  • Thanks 1

Share this post


Link to post
Share on other sites

See i wasnt sure if that was actually going to work. Thanks MTG 👍

Maybe im just too busy over thinking lmao

Share this post


Link to post
Share on other sites

I would use a switch statement though. Easier to read. 

 

I overthink things alot to.

Share this post


Link to post
Share on other sites

Using switch compared to if in my situation wont do a ton for readability because ive added the ability to dual wield certain types of gear i need the extra parameters from the if statements.

Share this post


Link to post
Share on other sites

For once, I have to agree with Sim!
A switch statement might be better suited here. It's a little more verbose, but that's part of the point here - easier to visually break the logic apart.
Still, an if statement would suffice, though you do sacriface a little readability for it.

Share this post


Link to post
Share on other sites

I would agree in some cases. But when you have 3 different variables in use, switch becomes less an option. With each class having their own gear and not being able to dual wield i need to prepare for it 

Share this post


Link to post
Share on other sites
On 7/31/2020 at 6:53 PM, Magictallguy said:

For once, I have to agree with Sim!
A switch statement might be better suited here. It's a little more verbose, but that's part of the point here - easier to visually break the logic apart.
Still, an if statement would suffice, though you do sacriface a little readability for it.

When it comes to code itself, your agree with me way more then you think. :)

  • Haha 1

Share this post


Link to post
Share on other sites

This is just the part I've been discussing... Lemme know if readability is really an issue here 😉 

if ($this->item_type == 0 && $this->allowdual > 0 && $this->user->weapon > 0) {
					$this->grabItem($this->user->weapon);
					if ($this->item_type == 1) {
						$equip_slot = "Main_Weapon";
					}
					else {
						$equip_slot = "Offhand"
					}
			}
			else if ($this->item_type == 0 && $this->allowdual < 1) {
					$equip_slot = "Main_Weapon";
			}
			//2 Handed swords
			else if ($this->item_type == 1 && $this->allowdual > 0 && $this->user->weapon > 0) {
					$this->grabItem($this->user->weapon);
					if ($this->item_type == 0) {
						$equip_slot = "Main_Weapon";
					}
					else {
						$equip_slot = "Offhand"
					}
			}
			else if ($this->item_type == 1 && $this->allowdual < 1) {
					$equip_slot = "Main_Weapon";
			}
			//Offhand weapons
			else if ($this->item_type == 2 || $this->item_type == 6 || $this->item_type == 7) {
				$equip_slot = "Offhand";
			}
			//Main weapons
			else if ($this->item_type == 3 || $this->item_type == 4 || $this->item_type == 5) {
				$equip_slot = "Main_Weapon";
			}
			//Armor
			else if ($this->item_type == 8) { $equip_slot = "Chest"; }
			else if ($this->item_type == 9) { $equip_slot = "Legs"; }
			else if ($this->item_type == 10) { $equip_slot = "Boots"; }
			else if ($this->item_type == 11) { $equip_slot = "Shoulders"; }
			else if ($this->item_type == 12) { $equip_slot = "Arms"; }
			else if ($this->item_type == 13) { $equip_slot = "Hat"; }
			//Accessories
			else if ($this->item_type == 14) {
				if ($this->user->ring1 < 1)  { $equip_slot = "Ring_1"; }
				else if ($this->user->ring2 < 1)  { $equip_slot = "Ring_2"; }
				else if ($this->user->ring3 < 1)  { $equip_slot = "Ring_3"; }
				else { $equip_slot = "Ring_1"; }
			}
			else if ($this->item_type == 15) {
				if ($this->user->necklace1 < 1) { $equip_slot = "Necklace_1"; }
				else if ($this->user->necklace2 < 1) { $equip_slot = "Necklace_2"; }
				else { $equip_slot = "Necklace_1"; }
			}

 

For some reason, copy/pasting from Atom didn't like me much. Way more indentation that It should be.

It's been a minute since i last updated; The inventory system is 3/4 done. It now has the option to have packages that can include up to 9 items. I converted a system for it just because I the tutorial completion kit took a ton of extra effort just for once package. So why not make it so you can have things bundled up. Since i was reworking the inventory system, i kind of overhauled the items system as well, consumables will be a thing. The guild vault is pretty much done minus the addition of the way the new items are set up. In the guild vault you'll be able to store items and copper. Items will be able to be loaned out at some point in the soon future. A bunch of the buildings for the guild have been added. They can be leveled although they don't do anything specific yet. Cheers :) 

Share this post


Link to post
Share on other sites

I've also taken up MTG's advice about using timestamp as a better way to handle cron related deals. Thanks to @Dayo's example i was able to make something that'll fit my needs.

NPC's now work on a spawn system, the option to spam refresh when attacking NPC's is now gone. Energy can now be gained every 5 mins.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

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


×
×
  • Create New...