1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Other Clockwork Constructors - Construct your own items, factions, and plugins! (RELEASED)

Discussion in 'Development' started by RJ, Mar 5, 2017.

  1. RJ

    RJ no pay Legend Clockwork Customer

    • Like Like x 1
  2. RJ

    RJ no pay Legend Clockwork Customer

    The Faction Constructor for Clockwork Constructors has been released!

    Feedback, suggestions, pointing out exploits are all welcome! There's been some more additions besides the Faction Constructor as outlined in the new Site Changelog:

    [​IMG]
     
    • Like Like x 2
  3. Aspect

    Aspect =) Legend Clockwork Customer

    I just had a thought. Can't you make it so the file's name follows the alias of each file?
    For example, if I am making an item and set it's unique id to, for example "avocado", the file name will become "sh_avocado.lua"
     
  4. RJ

    RJ no pay Legend Clockwork Customer

    I could yeah, but it opens up the same security issue(s) as mentioned before.
     
  5. Aspect

    Aspect =) Legend Clockwork Customer

    Such as? I don't really understand what issues you would have..
     
  6. RJ

    RJ no pay Legend Clockwork Customer

    I remember reading something about it awhile back, I'm not entirely sure about it and as I said I have to read more in to it. I'm just going to stay on the safe side for now and leave it up to the user to rename it after downloading.

    edit: I think it was something to do with the user being able to escape out of the current directory/file with some sort of exploit and then they could download any file they please.
     
    • Informative Informative x 1
  7. RJ

    RJ no pay Legend Clockwork Customer

    A quick fix release: Site stats was only showing the first number per constructor instead of the entire number, this also caused the total number of constructions to be incorrect. This has been fixed now.

    The actual stats wasn't affected, it was just a display and calculation issue.
     
  8. RJ

    RJ no pay Legend Clockwork Customer

    I've been working on flushing out the Item Constructor with more options and base specific inputs:

    [​IMG]

    [​IMG]

    [​IMG]

    I got most, if not all, inputs created for the Alcohol Base, and some for the Ammo Base.
     
    • Good Coder Good Coder x 1
  9. RJ

    RJ no pay Legend Clockwork Customer

    Clothes Base inputs for the Item Constructor + other additions:

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    edit: Also grenade and weapon base, nothing fancy:

    [​IMG]

    [​IMG]
     
    • Good Coder Good Coder x 1
    Last edited: Mar 20, 2018
  10. RJ

    RJ no pay Legend Clockwork Customer

    Alright so a lot of the code logic is done for handling base specific inputs. All that's left is to make the user-inputs write to the item file accordingly. Here's some code to look at for how generating a download works:

    PHP:
    case 'item':
        if (
    isItemInputsSet()) { // TODO check if inputs are set for items using a base
            
    $itemBase cleanValue($_POST['itemBase']);
            
    $itemName cleanValue($_POST['itemName']);
            
    $itemDescription cleanValue($_POST['itemDescription']);
            
    $itemModel cleanValue($_POST['itemModel']);
            
    $itemCategory cleanValue($_POST['itemCategory']);
            
    $itemCost cleanValue($_POST['itemCost']);
            
    $itemWeight cleanValue($_POST['itemWeight']);
            
    $itemBatch cleanValue($_POST['itemBatch']);
            
    $itemConsumable cleanValue($_POST['itemConsumable']);
            
    $itemDroppable cleanValue($_POST['itemDroppable']);

            
    $itemConstructor = new Item();

            
    $itemConstructor->base $itemBase;
            
    $itemConstructor->name $itemName;
            
    $itemConstructor->description $itemDescription;
            
    $itemConstructor->model $itemModel;
            
    $itemConstructor->category $itemCategory;
            
    $itemConstructor->cost $itemCost;
            
    $itemConstructor->weight $itemWeight;
            
    $itemConstructor->batch $itemBatch;
            
    $itemConstructor->consumable $itemConsumable;
            
    $itemConstructor->droppable $itemDroppable;

            switch(
    $itemConstructor->base) {
                case 
    $itemConstructor->BASE_ALCOHOL:
                    
    $itemAlcoholAttributeBoosts cleanValue($_POST['itemAlcoholAttributeBoosts']);
                    
    $itemAlcoholDrunkenExpiration cleanValue($_POST['itemAlcoholDrunkenExpiration']);
                    
    $itemAlcoholDrinkable cleanValue($_POST['itemAlcoholDrinkable']);

                    
    $itemConstructor->$alcoholAttributeBoosts $itemAlcoholAttributeBoosts;
                    
    $itemConstructor->$alcoholDrunkenExpiration $itemAlcoholDrunkenExpiration;
                    
    $itemConstructor->$alcoholDrinkable $itemAlcoholDrinkable;
                break;
                case 
    $itemConstructor->BASE_AMMO:
                    
    $itemAmmoAmount cleanValue($_POST['itemAmmoAmount']);
                    
    $itemAmmoClass cleanValue($_POST['itemAmmoClass']);

                    
    $itemConstructor->$ammoAmount $itemAmmoAmount;
                    
    $itemConstructor->$ammoClass $itemAmmoClass;
                break;
                case 
    $itemConstructor->BASE_CLOTHES:
                    
    $itemClothesGroup cleanValue($_POST['itemClothesGroup']);
                    
    $itemClothesProtection cleanValue($_POST['itemClothesProtection']);
                    
    $itemClothesReplacement cleanValue($_POST['itemClothesReplacement']);
                    
    $itemClothesWhitelist cleanValue($_POST['itemClothesWhitelist']);

                    
    $itemConstructor->$clothesGroup $itemClothesGroup;
                    
    $itemConstructor->$clothesProtection $itemClothesProtection;
                    
    $itemConstructor->$clothesReplacement $itemClothesReplacement;
                    
    $itemConstructor->$clothesWhitelist $itemClothesWhitelist;
                break;
                case 
    $itemConstructor->BASE_GRENADE:
                    
    $itemGrenadeUniqueID cleanValue($_POST['itemGrenadeUniqueID']);

                    
    $itemConstructor->$grenadeUniqueID $itemGrenadeUniqueID;
                break;
                case 
    $itemConstructor->BASE_WEAPON:
                    
    $itemWeaponUniqueID cleanValue($_POST['itemWeaponUniqueID']);

                    
    $itemConstructor->$weaponUniqueID $itemWeaponUniqueID;
                break;
            }

            
    $downloadURL $itemConstructor->build($previousPage);
        } else {
            
    exitConstruction('FAILURE, MISSING ITEM DATA POST');
        }

    break;
     
    • Good Coder Good Coder x 2
  11. RJ

    RJ no pay Legend Clockwork Customer

    I've gotten the user inputs setup so that they write to the item file accordingly. All that's left to do is make the alcohol attribute boosts button add new lines of attributes/values to boost by, handling that data in the backend, and then testing things. This is the alcohol attribute boosts I'm talking about:

    [​IMG]

    The next release should be within a week.
     
    • Good Coder Good Coder x 1
  12. RJ

    RJ no pay Legend Clockwork Customer

    • Like Like x 1
  13. dead flag blues

    dead flag blues "...ours is a world of nuclear giants..." Clockwork Customer

    Looks pretty cool, RJ.
     
    • Like Like x 1
    • Agree Agree x 1
  14. RJ

    RJ no pay Legend Clockwork Customer

    Thank you!
     
  15. RJ

    RJ no pay Legend Clockwork Customer

    I've finished testing and after many bug fixes it looks like things are working as expected. I think all that's left is to update the download summary page so it displays all of the new info that's being added. :)
     
    • Winner Winner x 3
  16. RJ

    RJ no pay Legend Clockwork Customer

    The Base Specific Fields for the Item Constructor on Clockwork Constructors has been released!

    Check out the Site Changelog for a full list of changes! Also let me know if there's any bugs and I'll fix them ASAP.

    Pictures:
    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]
     
  17. RJ

    RJ no pay Legend Clockwork Customer

    Hey Clockwork developers, it's been awhile. I've completed some preliminary work on the Command Constructor:

    [​IMG]

    [​IMG]

    Feedback is always welcome. :)
     
    • Good Coder Good Coder x 3
  18. TacticalToaster

    TacticalToaster Clockwork Customer

    Looking pretty good, seems like everything you'd need to start a command.
     
    • Like Like x 1
  19. Is the site down?
     
    • Agree Agree x 1
  20. Aspect

    Aspect =) Legend Clockwork Customer

    @RJ
     
    • Agree Agree x 1

Previous Readers (Total: 0)