Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Multiplayer problems, userspecific values

Discussion in 'Visual Scripting' started by Takeshi, Feb 6, 2018.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Takeshi Apprentice Engineer

    Hi to all,
    was playing around with VS to create a race script.
    To Test it, i invited a Friend and now i have two Problems:
    - Using the "Area entered Trigger" and "add GPS", my friend entered the Area and i got the GPS Point added, while using the PlayerID from the trigger event --> Bug or normal? How to fix it?
    - i was using a Int to count the number of waypoints, but i was not able to create one value, they only count for the palyer/Client, and has for every player a different count, is that not possible?

    Or is the VS only designed for the scenarios and it is not possible, to use playerspecific stuff?

    Thanks for the help.
  2. 666Savior Apprentice Engineer

    So if i am correct, you were trying to make it where if a player enters the trigger on a checkpoint, it would give them the GPS for the next checkpoint. This image will accomplish this, it also has a bit on the end that will remove the previous gps for the player to reduce screen clutter.

    This second image is a refined automatic system that can handle as many checkpoints as you want. Just increase the value for 'last' on the for loop. What the second image does is when a character enters a trigger, it goes in a loop to determine what checkpoint they are at. Once it matches, it gives the GPS for the next checkpoint and deletes the GPS for the current waypoint. As of right now, it does not have anything to prevent a player from skipping checkpoints.

    This second image should be enough for you to run a basic racecourse. Player count is unlimited, checkpoint count is basically unlimited, just make sure your waypoints are in numerical order. And make sure names of stuff match, or else it will not work.

    Feel free to use this, and if you have any questions i can explain it in better detail.
  3. Takeshi Apprentice Engineer

    Thx for your reply,
    then i will create a bugreport soon, the one from the first picture looks like mine and i use the Int64 Player ID to do stuff. But as i wrote another one start the trigger and i got the action.

    For the second picture, my script is working fine and it do all the stuff i need (set GPS, delete GPS/ check Waypoints / ....). The Problem was, it is not restricted to me. My question was going to know, if a variable in vs is global, or is this one restricted to the client/user. If i understand you right, then the script should run on the client and it works for every player itsself.

    I was Host, my friend was client on my PC, not DS. And it looks like if he is triggering something, i got the result/action.
    Will create a short example, like your first and test it again and create a bugreport.
    Thx, Takeshi
  4. 666Savior Apprentice Engineer

    Based on what you are saying, it sounds like either you have something not connected where it should be or the VST is not working correctly. I would have to view the actual script to determine if your script is set correctly. If you don't mind tossing me a picture or a copy of the script, i can look it over and see if i can find any issues with it.
  5. Takeshi Apprentice Engineer

    I think the first problem with getting action if the other player triggers something was realy a connection problem in the VST.

    But the Problem with the variable is still there, maybe my opinion is wrong, but see the example. My opinion was, for multiplayer, every player gets a own value. But every trigger, Host or not host count +1.
    (The Race script is too large to show, but this counterproblem is the core problem)

    Thx for help.
    (dont get the image to load in the spoiler frame, any hint?)
    Last edited: Feb 8, 2018
  6. 666Savior Apprentice Engineer

    The image isnt loading for me, might be on my end, not sure. To get an image inside a spoiler, first click the insert icon and select spoiler. then press enter a few times then click image and put your image link in. That wil place your image in a spoiler so it doesn't take up so much room.

    Having every player have a value is going to be difficult and would require a few list variables. That's probably why your script isn't working the way you intended. I'll have to wait until the picture works to see if my guess is right or not.
  7. Takeshi Apprentice Engineer

    Please dont wait for the Image.
    Its :
    - a value, counter, INT
    - a trigger, entered Cockpit
    - setter counter = Arythmetic: counter + 1
    - show Message, dest: User and Message: Arythmetic: your count: + counter
    (because in the racescript i was using "waypoint xy" and xy was a counter)

    "Having every player have a value is going to be difficult and would require a few list variables"
    - Please explain that
    - is therer a limitation for number of users
    - are arrays possible?
    - can i split values (for exampe if i use String in list and the string is like: "Username:counter") [or you mean i use 2 lists and one is the name, one is the number?, how to hold them aligned]

    Not visible at the documentation.
    Thank you.
  8. 666Savior Apprentice Engineer

    As of right now there is no way to use arrays in the VST.

    What i mean about the lists is you you could technically create a list and each connected player id references a specific slot in the list. Hard part is if a player leaves, and a new player joins is you have to keep record of the change of player id and list location, along with clearing the value, assignment of slot and a few other things. Long story short, becomes really tedious.

    You could get away with a string list and maybe a list that determines what player ID has what slot in the string list. The more people that disconnect and join, the longer both lists will become. I can't really explain how to achieve it because i would have to go make a couple tests of it myself to get the most efficient way.

    As for your current script, again, i would have to see the actual script to be able to determine if its just a wrong connection or setup. Even a link to a picture of it on another site would work.
  9. Takeshi Apprentice Engineer

    Got it to work with load and store Int.
    For the short example of a userspecific counter it works fine.
Thread Status:
This last post in this thread was made more than 31 days old.