1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

Baby steps.

Discussion in 'Visual Scripting' started by Rogon, Jul 25, 2020.

  1. Rogon

    Rogon Trainee Engineer

    Messages:
    3
    I have watched the videos. I have attempted to follow Keen's "tutorial". It would seem that the VST tool has changed a bit since all that stuff was posted. Really though, the stuff that I have seen is "advanced?".

    I simply want to have a container in-game that sends a chat message once it has x amount of x in it.
    Just one object with one condition.
    A quick step-by-step would be very helpful.

    I have a feeling that this is not a simple thing but just in case it is I thought I would ask^^
     
  2. Rogon

    Rogon Trainee Engineer

    Messages:
    3
    Ok, so a lot of views but no bites.
    So lets try breaking this up a bit^^

    The new version of VRage has a "hold your hand" creation tool(HyHCT) for starting a new scenario.
    Everything that I have read talks about moving your files to the content directory but it seems this HYHCT creates the new files in the mod directory in your %appdata%? Is this correct?

    Do these files still need to be moved to the CustomWorlds folder in the content directory?

    -So I created an empty space custom world and put a single large container in it and gave it a unique name. I am hoping that is basically all I need to do in-game at this point.

    -Open VST and select 'Saved World' and select my world; gave it a name and greeted with "Unable to modify world" message~

    -Now the whole put stuff in box bit. Mission01_Start is pre populated with the 'Hello World' of VRage but I am guessing this can be deleted and start here~

    -I want a container in the game to check for stuff, I don't care what, but I want it to do something once the argument is satisfied.

    - For sake of examples: "Large_Container_A" needs to send me a chat message once Large_Container_A(gold_ore >= 100);

    Hope someone is inspired enough to help a fellow engineer out^^
     
  3. 666Savior

    666Savior Apprentice Engineer

    Messages:
    197
    To start with, its been over a year since I've done any sort of work with the visual scripting or SE in that regard, so i apologize if this doesn't work right away.

    The below logic should work for checking the cargo container and sending a message once you have enough ore in it (key word: should). If you want to have the script check for a different item/ore, you'll have to look up the typeID and subtypeID. You can find these in the various sbc files in the game's content folder. There are a few that contain the info you may need.

    If i remember correctly there is a difference between entity name and entity ID. You can view both by having the VST overlay open while in game and selecting the cargo container you want to check the inventory of. Once it's selected there should be a section that shows the entity ID and entity name. You can also change them there as well

    The below logic is in the 'Mission_Part' script. You could also put it in the 'Mission_Start' script if you want. It just needs to be attached to the update block so the game checks it on every update tick


    I've found that a lot of programming in the VST is trial and error, and lots of time spent trying to find the correct function. I don't believe there is any documentation of what each function does, but their names are normally enough to explain what it does.
     
    Last edited: Aug 5, 2020
  4. Rogon

    Rogon Trainee Engineer

    Messages:
    3
    This is very helpful. Looks very much like an over complicated function in Java^^ It is good to see that this is actually this logical; mainly for when I find stuff does not work, I have a bit more confidence it is me and not VRage.

    Thank you for your time Savior