Forum rules - please read before posting.

A few problems I couldn't find solution yet

I'm writing a single post so I won't spam the forum with too many questions.

1. Switching scenes
I found on this link https://adventurecreator.org/tutorials/switching-scenes in your documentation something about relative position. 
You said "The Player will still use the next scene's PlayerStart as the "base" position, but the relative position between the Player and this Marker will also be accounted for."  I'm not sure what this would mean, but I what I tried to achieve in my game was after an action took place to reload the scene, but my player would spawn in another location. So I did like this :

But when I reload the scene the player spawns in the default location. It is possible to make this work?

2. Variable format in UI

The next problem I got is showing a time in the UI. For some reasons I had to use a single variable for time so my time var  is a number like 748(07:48), 1420(14:20) and so on. 
For now in my menu I do like this :

And it's working. I can see the time, but is there any way to create a custom script that will show the time in another format. 

3. My game is a 3d game, but I would like to integrate some mini games. And this mini games would be much easier to do using AC, but I don't need the player, I just want to use the actions. It is possible to do something like that? 

Thank you 

Comments

  • 1. The "Relative Marker" feature will offset the player's starting point relative to their vector from the given marker before the scene switch occurs.  This is only really useful if you want the player switches scene via a wide doorway, and you want them to appear on the correct side of the doorway on the other side (similar to crossing rooms in the old Kings Quest games).

    If you want the player to appear in a specific point, you should use the Object: Teleport Action instead in your scene's OnStart cutscene.  Is reloading the scene really necessary however?


    2. Yes - a custom script can read one variable, format it, and write to a new one.  e.g. if Variable 3 is your time Integer, and Variable 5 is a String:

    void Update ()
    {
        int time = AC.GlobalVariables.GetIntegerValue (3);
        string timeString = time.ToString (); // Replace with actual format code
        AC.GlobalVariables.SetStringValue (5, timeString);
    }

    You can then have the Label display variable 5 instead.


    3. If a player is necessary for the rest of your game, you can just hide him from view by placing the Default PlayerStart behind the camera.  You can use the Player: Constrain or Engine: Manage systems Actions to prevent the player from being able to move when the minigame is active.
  • edited April 2018
    Thank you very much for you fast response as always.
    As for the question you asked me about " Is reloading the scene really necessary however". No it's not, but I encountered another problem which led me to reload the scene. 

    The problem I had was this:
    I have an NPC near a door which I spawned based on a variable (GameStatus). Near that NPC I added a trigger which was calling an action list.
    In this action list I had the first node (Start Conversation using PixelCrusher's Dialogue System) and then I was trying to do remove object from the scene. The problem is that if I was doing with hotspot everything was working fine, but when I did the same thing on a trigger I couldn't see the InGame UI after I was done with the conversation. I tried to find what was the problem so in the end I decided it was easier to reload the scene and then move the character to that point. 
    Anyway thank you for the idea of using teleport, because I will need to do something similar in some other cases where I'm changing the scene. 

    About the 2nd part of my question.
    It's not costly to change that var on Update? Is not there any OnChange event or something similar?

    Best regards 
  • edited April 2018
    • It's not costly to change that var on Update? Is not there any OnChange event or something similar?
    Yes, indeed.  If you update your Integer variable with either the Variable: Set Action, or by updating it through script, i.e.:

    GVar myIntVar = GlobalVariables.GetVariable (3);
    myIntVar.SetValue (21);

    ..then the OnVariableChange event will be called, which you can hook into to update the String.  See the "Variable scripting" chapter in the Manual for more.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.