[Mod] CommandCrate v1.21 (SpotGuard addon)

Discussion in 'The Hangar Bay' started by Exacute, Jul 23, 2018.

  1. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    1,043
    Likes Received:
    747
    The iteration is currently on-hold
    The new API will not be compatible with the old, so an entire rewrite is required.
    I've not yet decided on wether a complete rewrite is worthwhile to do or not..
    While there have been support for the project, the support havn't even covered the coffee I've consumed during development (To put it into perspective)

    It might happen, it might not. At the very least it won't before the new API have full support of all the old stuff & in a more stable place.
     
    #41
    SacredGlade and Taelyn like this.
  2. Patrick Stower

    Joined:
    Apr 19, 2017
    Messages:
    20
    Likes Received:
    11
    Exacute. My friend Juggoire has been using CommandCrate on his server. We have been trying to create a server with a background story and we want to make our own mods using CommandCrate. Our main problem is that we can find precious little documentation to help us learn how to code yaml files for the mods we want to make. Can you direct us towards some documentation that does not assume that I already know yaml coding, so that I can learn from scratch?
     
    #42
    SacredGlade likes this.
  3. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    1,043
    Likes Received:
    747
    YAML is a format
    like JSON or .csv (etc)

    I picked it because the rest of Empyrion is using yaml for any customization, so to make it easier for people running servers ;)

    The syntax for yaml is pretty straightforward, once you get that there's
    -Lists
    -Entries on these lists
    And that everything is tabulated

    https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html might help you out
    For the actual stuff, please refer to the documentation provided with this mod
    It includes several .yaml files aswell that you can use to get a good idea about how the syntax works
     
    #43
    SacredGlade likes this.
  4. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    Is this thread alive anymore? Exacute still around, in the event we have questions with coding?
     
    #44
  5. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    1,043
    Likes Received:
    747
    Yeah I'm still around ;)

    The mod development is kinda on standby tho, since the new modAPI is still not in a place I feel comfortable converting to yet.
     
    #45
  6. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    ok cool, good to know you're still around. I've struggled through and got many things working, but there are some things I can't get to work. One thing that is kicking my ass right now, is trying to set up a custom command to give a player an item that i select when running the command.

    This is what I have thus far that I thought made logical sense, but alas it doesn't work.

    I get error when it's loading on the line for the items down in the exucute area.

    Entries:
    - EntryKey: GiveStuff
    CommandEntry:
    - i: 0
    key: give
    type: key
    - i: 1
    key: target
    type: entityid
    optional: true
    - i: 1
    key: target
    type: playerid
    optional: true
    - i: 1
    key: target
    type: playername+
    optional: true
    - i: 2
    key: thing
    type: item
    - i: 3
    key: qty
    type: int
    optional: true
    defaultvalue: 1
    Requirements:
    - AboveAdmin: 2
    Actions:
    - Conditionals:
    - Conditions:
    - Condition: "{PlayerID}!={TargetID}"
    ExecuteCommand:
    - Text: "Item Sent Successfully"
    - BoxRedTarget: "The Primal Rage Gods are bestowing gifts upon you. Be grateful."
    Items:
    - Item: {thing}
    Amount: {qty}
    ItemDeliveryMethod: window
    ItemReceipient: target
    ItemTitle: "Gifts from the Gods"
    ItemDescription: "Blessings to you {target}, from the Primal Rage Admins."
     
    #46
  7. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    Also. when i downloaded the mods, i just put 5 bucks in there 'cause i did not know if i wanted to use them or not. Now that I have explored them, I see great potential in them and I really love what you've done. I believe in donating to those who put forth effort so I'd like to donate. Do you have a donate link? Or should I just go pretend to download again and do it that way.
     
    #47
  8. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    One other problem kicking my ass, and I have read and reread the supporting documentation, but I can't seem to put it together, I'd like to be able to run a command to give my VIP members one of the prefab starter SV's. If you could point me in the right direction on that, that would be superb. Sorry to throw so much at ya but I've been fully immersed in this for 2 weeks now trying to create a great environment for our members, so the questions have been building up. lol.
     
    #48
  9. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    1,043
    Likes Received:
    747
    The download method is effectively just a donate link, that redirects afterwards: So that is a fine method.
    I appreciate any support for future development - Especially since converting it to the new modAPI will take a silly amount of hours ;)
     
    #49
  10. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    1,043
    Likes Received:
    747
    Strange. Only the middle of your three posts showed up earlier.

    Either way. It's a bit tricky to see exactly what you did wrong due to the forum formatting - Please use the code tags another time :)
    I got your thing working tho;
    The issue was likely some wrong indentation. (Again, this is purely a guess), if so, a tip is to look at the documentation; notice the numbering (For instance 1.13.7.30.3 - this means it's under 1.13.7.30, which is under 1.13.7, which is under 1.13, which is under 1)

    Keep in mind that yaml is also rather pesky when it comes to recognize types; your 'Item: {thing}' is interpretated as an object, rather than a string. To not make yaml fall over reading it, you need to surround it with " (ie. 'Item: "{thing}"')

    Lastly, you may want to change {target} to {TargetName} ; As {target} just lists the players steamid ;)

    Code:
    - EntryKey: GiveStuff
      CommandEntry:
      - i: 0
        key: give
        type: key
      - i: 1
        key: target
        type: entityid
        optional: true
      - i: 1
        key: target
        type: playerid
        optional: true
      - i: 1
        key: target
        type: playername+
        optional: true
      - i: 2
        key: thing
        type: item
      - i: 3
        key: qty
        type: int
        optional: true
        defaultvalue: 1
      Requirements:
      - AboveAdmin: 2
      Actions:
      - Conditionals:
        - Conditions:
          - Condition: "{PlayerID}!={TargetID}"
        ExecuteCommand:
        - Text: "Item Sent Successfully"
        - BoxRedTarget: "The Primal Rage Gods are bestowing gifts upon you. Be grateful."
        Items:
        - Item: "{thing}"
          Amount: "{qty}"
        ItemDeliveryMethod: window
        ItemReceipient: target
        ItemTitle: "Gifts from the Gods"
        ItemDescription: "Blessings to you {target}, from the Primal Rage Admins." 
     
    #50
    Last edited: Aug 15, 2019
    Taelyn likes this.
  11. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    1,043
    Likes Received:
    747
    Okay. So you are using SG's specialslist to define who are VIP, yes?

    If so, you'd want to do a command similar to your give command above, with the conditionals being {TargetVIP} >= whatever level you want
    (You can use the requirements section if you want the player to be able to type the command - this have a VIP case, similar to the admin case you used above)
    This will make sure your target picked is vip (Unless I misunderstand, you want to manually run this command, yes?)

    As far as spawning structures, it is using the same interface as items currently, as it was originally just intended to be a small thing spawned together with items.. It might eventually get its own section for convenience, but..

    Basically you specify what BP to use as the deliverymethod
    The basic gist goes like this:
    Code:
      Actions:
      - ExecuteCommand:
        - Text: "Spawning fortress"
        ItemDeliveryMethod: AlienWall
        ItemXYZ: "{{RoundUp({PlayerX})}-26},{{PlayerY}-5},{RoundUp({PlayerZ})}"
        ItemROT: "0,270"
        ItemCustomName: WallLeft
        ItemFaction: alien
    (Here it would make a BP from the name AlienWall, spawn it at coordinates relative to the player, and rotate it 270 degrees on the y-axis. And name it 'WallLeft', and set its faction to 'alien')

    Please refer to the bits under 1.13.16 for exact documentation for values

    In your case where you want a SV, please be mindful of 1.13.25
     
    #51
    Taelyn likes this.
  12. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    I was thinking I must have not formatted it properly, because the logic of the command seemed legit. I will recheck the samples and instructions and outline it better. I also found another sample that surrounded the {thing} in quotes, tried it...but it didn't work...however....I believe now that it is indeed due to indentation. I will update, hopefully with success, once I make the changes.
     
    #52
  13. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    Yes, I have SG controlling our VIP list. The end game of what I want is to be able to run a command, maybe even later automate it so it triggers when it recognizes them at login, to issue them X amount of items and a SV as their "package" for being a VIP member.

    I have already created a working command that gives them the items. I just did not know how to include the SV.

    So my thought was to make a separate command to issue the ship separately.


    I will read all the areas you pointed out and see what I can come up with.
     
    #53
  14. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    Done. Thank you for all that you do. You have given us a great tool.
     
    #54
  15. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    This is what I have for Tier 1 VIP. To be issued manually for now, as I have not yet sorted through the steps to let SG speciallist do it. lol, baby steps.

    So, in a perfect world, I'd like to include one of the prefab SV's in this list. Or would it just be easier to make a separate command for the ship?

    Code:
    ##################################################################################################
    ###     Give Player VIP 1 Gear                                                                 ###
    ###     Ernicus Maximus 8/14/2019                                                              ###
    ###     Syntax   /vip1 playername/playerid                                                     ###
    ###     Sample   /vip1 ernicusmaximus                                                          ###
    ###     If you are using playername and it has a space in it, you must use quotes              ###
    ###         example  /vip1 'ernicus maximus'                                                   ###
    ##################################################################################################
    
    - EntryKey: GiveVIP1
      CommandEntry:
      - i: 0
        key: vip1
        type: key
      - i: 1
        type: playername+
        key: p1
        useastarget: 1
      - i: 1
        type: PlayerID
        key: p1
        useastarget: 1
      Requirements:
      - AboveAdmin: 2
      Actions:
      - Conditionals:
        - Conditions:
          - Condition: "{PlayerID}!={TargetID}" 
        ExecuteCommand:
        - BoxRedTarget: "Thank you for supporting the server! - Primal Rage gods"
        Items:
        - Item: ArmorLight
          Amount: 1
        - Item: AssaultRifleDebug
          Amount: 1
        - Item: DrillEpic
          Amount: 1
        - Item: DrillCharge
          Amount: 50
        - Item: MultiToolT2
          Amount: 1
        - Item: MultiCharge
          Amount: 50
        - Item: EmergencyRations
          Amount: 5
        ItemDeliveryMethod: window
        ItemReceipient: target
        ItemTitle: "VIP 1"
        ItemDescription: "VIP Tier 1 Items"
    
     
    #55
  16. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    I could not find the error, from my original post. I took the code you sent, applied it and it worked. I then went over 4 other commands I am working on and verified indentation, now they all work. So I was chasing my own tail. lol

    Thanks.

    oh, and good catch on the {targetname} lol. "Thank you 12356487 , we love you" as I call them a number instead of a name. lol
     
    #56
    Exacute likes this.
  17. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3

    So I wrote this and have not tested it yet, after having read the 1.13.16 as well as 1.13.25. I have to wait for our next server restart to see if it will work....but the logic looks right. I was not sure if it was possible to parametize (yeah...I made up a word) the ship name or just stick with hard coding the name in it.

    I'll let you know if it works, or if you see this before my update...let me know if you see a flaw. lol

    Code:
    ##################################################################################################
    ###     Give Player a ship (of choice)                                                         ###
    ###     Ernicus Maximus 8/14/2019                                                              ###
    ###     Syntax   /give playername/playerid/entityid prefabname                                 ###
    ###     Sample   /give ernicusmaximus SV_Prefab_Tier1 1                                        ###
    ###     If you are using playername and it has a space in it, you must use quotes              ###
    ###         example  /give 'ernicus maximus' SV_Prefab_Tier1 1                                 ###
    ##################################################################################################
    
    Entries:
    - EntryKey: GiveStuff
      CommandEntry:
      - i: 0
        key: give
        type: key
      - i: 1
        key: target
        type: entityid
        optional: true
      - i: 1
        key: target
        type: playerid
        optional: true
      - i: 1
        key: targetname
        type: playername+
        optional: true
      - i: 2
        key: thing
        type: item
      - i: 3
        key: qty
        type: int
        optional: true
        defaultvalue: 1
      Requirements:
      - AboveAdmin: 2
      Actions:
      - Conditionals:
        - Conditions:
          - Condition: "{PlayerID}!={TargetID}"
        ExecuteCommand:
        - Text: "Item Sent Successfully"
        - BoxRedTarget: "The Primal Rage Gods are bestowing gifts upon you. Be grateful."
        Items:
        - Item: "{thing}"
          Amount: "{qty}"
        ItemDeliveryMethod: "{thing}"
        ItemBPT: 4
        ItemReceipient: target
        ItemTitle: "Gifts from the Gods"
        ItemDescription: "Blessings to you {targetname}, from the Primal Rage Admins."
    
     
    #57
  18. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    Ok, so I tried the one to spawn a ship and got this error

    Property 'ItemBPT' not found on type 'CommandCrate.Config.ConfigYaml+Actions'.


    I was pretty sure the directions said to use ItemBPT. I'll go re-read and make sure I didn't miss something.
     
    #58
  19. Exacute

    Exacute Rear Admiral

    Joined:
    Feb 17, 2017
    Messages:
    1,043
    Likes Received:
    747
    Glad to hear you're finding the tool usefull ;)
    Feel free to share anything cool you make with it, if you feel like it.

    Okay. So to your questions:

    It would be somewhat tricky to differentiate between item and blueprint - There is no native method for this currently. It's not a terrible idea to do natively at some point, but don't expect anything anytime soon (As I mentioned, I'm waiting for the ModAPI to become more stable, which might easily take a year at Eleon phase :p) Then comes rewriting it, which is 'close-to-starting from raw', which may take some several months ontop of that; Then for any improvements (Just to give you a timeframe)

    So I'd recommend having the item & blueprint spawning being seperate entitities.
    You *can* sorta do it, if you always give them an item aswell, by adding another parameter for a string referencing a blueprint, and adding another action for doing this (The same action can only handle either giving items, or spawning something) - but having multiple actions is easy within the same command.
    It's up to you which you opt. for, but I think another command would be the easiest for you really

    No. If you are considered an admin on the server according to CC's config file, you can use the ingame command '.<namespace> rld cnf' to reload all configuration files (Reloads what commands are availible, and should apply any changes you've made to the files etc)

    (I'd always recommend testing on a local server, but you can do this on any server :) )

    It's ItemBPType :)
    1.13.25 is to define the type of what is spawned, as it -atleast when I wrote it, new modAPI *might* offer a way- wasn't possible to auto-detect what the type of bp natively is (So it defaults to being a 'base', unless you specify something else here)
     
    #59
  20. Ernicus Maximus

    Joined:
    May 7, 2019
    Messages:
    17
    Likes Received:
    3
    "It's ItemBPType :)"

    ugh...i've been staring at code too long between this and work. lol. /dumb.

    thanks.
     
    #60
    Exacute likes this.

Share This Page