About Store Forum Documentation Contact



Post Reply 
Please give some suggestion about modding for EE games
Author Message
tipforeveryone Offline
Member

Post: #1
Please give some suggestion about modding for EE games
This is my purpose:
- I want my game to have modding support
- Modder can create his own content like guns, attachments, map etc
- This is how I expect to load custom content like that:
--- There will be a folder named "mods" or "addons" in main game folder, which includes some child category folders e.g "guns", "attachments", "characters
--- Content creators, modders may put theirs files in corresponding folders. e.g: put all related files for his new gun in "addon/guns/m4a1-custom"
--- When playing game, all content in "mods" and "addons" will be loaded in game

Please give me proper way to achieve my purpose. It might be some useful functions which helps me to parse external files to usable stuff for EE. or another better way?
08-28-2021 02:33 AM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Member

Post: #2
RE: Please give some suggestion about modding for EE games
my expected pipeline is:
I will create a tool which:
1. modder put all required files (fbx, wav, xml etc) into a designated folder
2. modder just need to press a button to:
- Do the same what Editor does: get data and make files from fbx (object, sound, animation)) assign UID/random file name !jlke9193xxx for each of them
- Pack all generated files to an .pak file
3. put that .pak file to mods folder of main game
4. load data from that pak instead of get data from fbx to a temporary data everytime game load
I think when everything packed in a pak file, then load it from the begining, it should be faster

Is this a good way to go ?
08-30-2021 02:45 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: Please give some suggestion about modding for EE games
That's good approach, but I would recommend to just tell modders to use Esenthel editor, import the files, and you can export Pak from the editor. It would take a lot of work to make your own tool that does similar stuff.
08-30-2021 05:16 AM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Member

Post: #4
RE: Please give some suggestion about modding for EE games
Thanks for reply,

I follow this approach, using EE itself. I create a new project, import fbx file to get all needed files (obj, material, animation etc) then export data as a .pak file.

In my main game, I can find the exact a file I need by it filename but it get in problem.
---------------------------
Can't load Object "7gbx_pmb64y5q1y1rgsz8hl!"
---------------------------

Code:
Pak pak;
      if(pak.load("mods/guns/ak47/ak47.pak"))
      {
         REPA(pak.files())
         {
            if(pak.files()[i].name == S+"7gbx_pmb64y5q1y1rgsz8hl!") // This is the file I want to find which is an object
            {
               UID id; DecodeFileName(pak.files()[i].name, id);
               ObjectPtr op = id; //This one does not work
               Game.World.objCreate(*op, Matrix(Vec(0, 5, 0)));
               break;
            }
         }
      }

I just want to spawn object saved in pak file to main game world. Please advice!
(This post was last modified: 08-30-2021 06:23 PM by tipforeveryone.)
08-30-2021 06:22 PM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Member

Post: #5
RE: Please give some suggestion about modding for EE games
How can I use pak file as it is ? all structure, files inside as main game's
08-31-2021 01:58 AM
Find all posts by this user Quote this message in a reply
KrysleQuinsen Offline
Member

Post: #6
RE: Please give some suggestion about modding for EE games
(08-30-2021 06:22 PM)tipforeveryone Wrote:  Thanks for reply,

I follow this approach, using EE itself. I create a new project, import fbx file to get all needed files (obj, material, animation etc) then export data as a .pak file.

In my main game, I can find the exact a file I need by it filename but it get in problem.
---------------------------
Can't load Object "7gbx_pmb64y5q1y1rgsz8hl!"
---------------------------

Code:
Pak pak;
      if(pak.load("mods/guns/ak47/ak47.pak"))
      {
         REPA(pak.files())
         {
            if(pak.files()[i].name == S+"7gbx_pmb64y5q1y1rgsz8hl!") // This is the file I want to find which is an object
            {
               UID id; DecodeFileName(pak.files()[i].name, id);
               ObjectPtr op = id; //This one does not work
               Game.World.objCreate(*op, Matrix(Vec(0, 5, 0)));
               break;
            }
         }
      }

I just want to spawn object saved in pak file to main game world. Please advice!
There used to be a Pak tutorial but it was so long time ago.

IIRC, you have to specify a path to the ObjectPtr if it is external.
Code:
ObjectPtr op; op.require("7gbx_pmb64y5q1y1rgsz8hl!", "mods/guns/ak47/ak47.pak");
Or perhaps add a mod pak to Paks first.

Code:
Paks.add("mods/guns/ak47/ak47.pak");
ObjectPtr op = "7gbx_pmb64y5q1y1rgsz8hl!";
(This post was last modified: 08-31-2021 03:40 AM by KrysleQuinsen.)
08-31-2021 03:38 AM
Find all posts by this user Quote this message in a reply
tipforeveryone Offline
Member

Post: #7
RE: Please give some suggestion about modding for EE games
Awesome !!
Paks.add("mods/guns/ak47/ak47.pak");
ObjectPtr op = "7gbx_pmb64y5q1y1rgsz8hl!";
This works
Thank you so much !
08-31-2021 06:20 AM
Find all posts by this user Quote this message in a reply
Post Reply