Jump to content
MakeWebGames

Plans for GL 2.4.0


Dayo

Recommended Posts

Just thought I would post my plans for GL 2.4.0 here and everyone can give their opinions/suggestions.

  1. New Item System
    1. The current item system is very limited, I wanted to expand on it.
    2. It is quite a core function of a game and IMO shouldn't be behind a pay wall so this will be part of the core framework and not behind GL Premium
    3. At the core it will just be a very basic system where items can be one of either (Wearable, Consumable or Ammo)
    4. Items can have one or many effects i.e. +10% Attack, +15% Health etc ... 
  2. A Premium membership feature
    1. With points you will be able to become a premium member
      1. Im not sure what sort of benefits to give the member here, i did just think about giving them a special colour etc ...
      2. I can provide hooks so people can make custom modules that use this.
  3. Improve the core database structure by implementing foreign keys

If you think there is anything else you want in the next release just ask, ETA for this i would like to say is mid/end of June i would like to ssay this year but it can always slip to 2022 lol 

Edited by Dayo
  • Like 4
Link to comment
Share on other sites

I still want to see hooks in ACP for when entry added, deleted, edited.

module, type & id # passed. 

An easier way to alter ACP templates or sub templatrs in general be great.

Ex: adding additional fields to already created module in ACP. My Advance Crimes module for example: It had to replace the original crimes module instead of a lot of nasty code(instead of threw alterTemplate? Hook with str_replaces.

Adding additional JS was the real pain. Ex: Auto-Spelling like this Forum tagging system.

Link to comment
Share on other sites

@Sim in the case of your advanced crimes I think the user should have to deactivate the old one to install the new one. In your case your mod changes the .inc .tpl .hook .admin files … it is a whole different mod.

I can see a scenario where you would want this I.e. on the user panel you may want to add new fields for admins to edit.

But this would be module by module for me/developers to implement. 

4 hours ago, PHPStudent said:

Looking forward to the item system overhaul Dayo and maybe an alternative attack system too that's similar to that of mccodes ? 

A lot of people have asked for this, I was thinking about releasing it as a free mod then people can deactivate kill and activate attack 

  • Like 3
Link to comment
Share on other sites

I second the attack, being turn based with an advanced (enhanced) item system. Since i use Sims perhaps build on his to save me some trouble lol Daily jobs would be another and maybe a newspaper system. What I'd like to also see is a really updated looking forum and instant chat system to build the games player interaction/communication. 

We can take a lot of things/ideas from mccodes and GL them lol

Link to comment
Share on other sites

An updated forum system is a definite. Ive thought about recreating it several times. I did code a forum hosting service from scratch(BAD IDEA for any1 thinking of doing it).

He cant build upon mine @Canjucks It edits the core code which @Dayo is against and TBH it kind of needs a recode. The custom item types code is a mess since i originally didnt have it as an idea or realize the complexity of it at first.

And its a paid mod which means he cant legally release it. I did give him permission to go over the code to give himself ideas, or release mods upon it.

One of the most important things i would like to see is better placement of userAction hooks. Lets take the crimes.inc file for example:

                    if ($cashReward) {
                        $rewards[] = '$'.number_format($cashReward);
                    }
                    if ($bulletReward) {
                        $rewards[] = number_format($bulletReward) . ' bullets';
                    }

                    $crimeError = array("text"=>'You successfuly commited the crime and earned '. implode(" and ", $rewards) .'!');
                    $this->alerts[] = $this->page->buildElement('success', $crimeError);
                    $this->user->set("US_money", $this->user->info->US_money + $cashReward);
                    $this->user->set("US_bullets", $this->user->info->US_bullets + $bulletReward);
                    $this->user->set("US_exp", $this->user->info->US_exp + $crimeInfo->C_exp);
     
                    $actionHook = new hook("userAction");
                    $action = array(
                        "user" => $this->user->id, 
                        "module" => "crimes", 
                        "id" => $crimeID, 
                        "success" => true, 
                        "reward" => $cashReward
                    );
                    $actionHook->run($action);
                    if ($cashReward) {
                        $rewards[] = '$'.number_format($cashReward);
                    }
                    if ($bulletReward) {
                        $rewards[] = number_format($bulletReward) . ' bullets';
                    }
                  //added EXP to rewards for hook
                  $rewards[] = $crimeInfo->C_exp;
                  //moved hook BEFORE DATA BEFORE UPDATED IN DB.
                    $actionHook = new hook("userAction");
                    $action = array(
                        "user" => $this->user->id, 
                        "module" => "crimes", 
                        "id" => $crimeID, 
                        "success" => true, 
                        "reward" => $rewards //changed cashRewars to all rewards
                    );
                    $actionHook->run($action);
                    
                    $crimeError = array("text"=>'You successfuly commited the crime and earned '. implode(" and ", $rewards) .'!');
                    $this->alerts[] = $this->page->buildElement('success', $crimeError);
                    $this->user->set("US_money", $this->user->info->US_money + $cashReward);
                    $this->user->set("US_bullets", $this->user->info->US_bullets + $bulletReward);
                    $this->user->set("US_exp", $this->user->info->US_exp + $EXP);

 

This allows for hooks to change data before being updated by applying this to hook.

 

new hook("userAction", function (&$data) {
			
  global $db, $user;
  //if module isn't crime exit
  if($data['module'] != "crimes")
  {
    return;
  }
  
  //if not successful crime exit
  if($data['success'] != true)
  {
    return;
  }
  
  //if premium member/item bonus APPLY
  $data['rewards'][0] = $data['rewards'][0] + 10; //UPDATE cash
  $data['rewards'][1] = $data['rewards'][1] + 10; //UPDATE bullets
  $data['rewards'][2] = $data['rewards'][2] + 10; //UPDATE exp

 

Link to comment
Share on other sites

47 minutes ago, Dayo said:

I can certainly add hooks to manipulate module data.

They Dont need added. Just moved for the most part. The &$data will reference the data automatically. (Knowledge for others. Not directed to you @Dayo im 99.9% sure you know this).

Link to comment
Share on other sites

18 hours ago, Sim said:

They Dont need added. Just moved for the most part. The &$data will reference the data automatically. (Knowledge for others. Not directed to you @Dayo im 99.9% sure you know this).

The way i would do it is a bit different and a lot more flex-able rather then edit the output you would edit the input like so.

<?php
/* crimes.hooks.php */
new hook("crimeData", function ($data) {
	$data["C_cooldown"] *= 0.9;
	$data["C_money"] *= 1.1;
	return $data
});

/* crimes.inc.php */
public function method_commit() {

	/* ... */

	$crime = $this->db->select("SELECT * FROM crimes WHERE C_id = :crime", array(
		':crime', $crimeID
	));

	$hook = new Hook("crimeData");
	$crimeInfo = $hook->run($crime, true);

	/* ... */
}

 

Edited by Dayo
  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

How about an update to the templating system?

Instead of the template data being a property you could make a method be the "view" since you have limited ability with a property.

So in *.admin.php:

$this->page->buildElement('templateData', $vars)

Would render in *.tpl.php

public function templateData() {
	//in here I can access the $vars array data
}

I think that would provide much more flexibility in the long run

Edited by KyleMassacre
  • Like 1
Link to comment
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...