Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Building modding on top of FPS Sample :). Where can I modify clipSize?

Discussion in 'FPS.Sample Game' started by Axonn, Apr 2, 2020.

  1. Axonn

    Axonn

    Joined:
    Nov 26, 2019
    Posts:
    48
    Hello :). I'm working on a modding system for the game that works without using the Editor.

    Does anybody know where

    Code (CSharp):
    1. public struct Settings : IComponentData
    is being initialized? It's a bit difficult to find through the heaps of code & calls :)

    I'd like to change stuff such as clipSize and damage.

    I found the GameDesign folder thanks to watching the Getting Started video. That's where the clipSize is coming from. But what if I want to change it programatically?

    Thank you in advance! :)
     
    Last edited: Apr 2, 2020
  2. Axonn

    Axonn

    Joined:
    Nov 26, 2019
    Posts:
    48
    Anybody? :). Pretty please with organic sugar on top?
     
  3. Stexe

    Stexe

    Joined:
    Feb 2, 2014
    Posts:
    217
    I forget off hand but I have seen it done. You're going to have to look into how they have it set up with ECS. Either way, it is going to be annoying and a challenge since you most likely have to have server verification and other stuff.
     
    Axonn likes this.
  4. Axonn

    Axonn

    Joined:
    Nov 26, 2019
    Posts:
    48
    Hey! Thank you for answering! :). Felt a bit lonely here for a while, haha.

    For now, I'll be grateful if I can even find where it gets the value. Getting all clients in sync will be the next step :)
     
  5. karstenv

    karstenv

    Joined:
    Jan 12, 2014
    Posts:
    81
    The value is stored in a scriptable object (SO) somewhere in a folder. Its been a while since I used this so cant remember where. But each weapon has a SO with its data. Here you can also change damage etc....
    A SO is a script that is not attached to a gameobject like normal scripts and its been read at runtime.

    You can also make new weapons classes this way and ever new characters which is also using these SO.
     
    Axonn likes this.
  6. Axonn

    Axonn

    Joined:
    Nov 26, 2019
    Posts:
    48
    Excellent! :). I found it! It's actually not using SOs, but rather IComponentData. The class Ability_Chaingun : CharBehaviorFactory has a public struct Settings : IComponentData that is modifiable via the Editor.

    HeroTypeAsset, however, is inherited from ScriptableObject, also modifiable via Editor.

    Not sure I understand yet what's the reasoning behind using both SOs and ECS, or what is the relation between ECS's IComponentData and SO.