Krapfenmann's Recent Forum Activity

  • Guys i have a strange problem and i don't know why this is (was) happening but i need some feedback from you C3 pros. I'm doing a "Bust a Move" like game and like to do some Functions with return value.

    Every orb (Objectname: Ball_Object) in my game belongs to the family "Ball".

    There is this funtion with a string return value: "TestNeighbour(Ball_Object.UID)".

    "TestNeighbour" will pick the ball with the UID, then start a loop to test an Instance of family "Ball" overlapping point around 6 coordinates, at a fixed distance every loopindex * 60 degrees around it. This tests if the neighbour ball is actually there. I do this calculation with a simple, also returning trigonomic function i wrote which returns X and Y. Every found UID is saved in an string variable, which i will return at the end.

    I tested this function when mouse clicking on instances of Ball_Object and it works fine!

    Now i want to do a loop, testing all balls as long as new are found. I use several loops to perform different actions. Main loop is a for loop. The code is not so big and i use nested loops for repeated actions. Everything works fine till i get to the nested while loop. NO it's not hanging up but i recognised a strange behaviour which drives me mad. I want to set a local variable called: "current_neighbours" to the return value of "TestNeighbour" with simply doing:

    Set "current_neighbours" to Functions.TestNeighbour(Ball_Object)

    Thats all i'm doing and directly testing "current_neighbour" afterwards it contains nothing. I mean really nothing.

    At first i thought my function was wrong and returned nothing. But debugging and testing it showed that it works.

    Then setting a breakpoint into my function revealed, that the function was not even called. Step, by step debugging showed, the programm got to the point where i set the variable to this function return value and it got completely ignored. Like i haven't typed anything at all. "current_neighbors" =

    After having always problems with nested loops and functions i tried our something dirty. Instead of a loop in the Function "TestNeighbour", i deleted the loop and copied the same code 6 times in a row. And what should i say, it works. Now my variable is set to the return value.

    In code the main program looks like this:

    -----

    for loop

    {

    while

    {

    ... (Some code before)

    current_neighbours = Functions.TestNeighbour(Ball_Object.UID)

    ... (Some code afterwards)

    }

    }

    -----

    So what is going on there and why does this not work:

    -----

    string TestNeighbour(Ball_Object.UID)

    {

    Pick Ball_Object with Ball_Object.UID

    string variable_to_return = ""

    loop type of your coice (6 times)

    {

    Do this and add UID of found, surrounding Balls to variable_to_return

    }

    return variable_to_return

    }

    ------

    But this works fine:

    ------

    string TestNeighbour(Ball_Object.UID)

    {

    Pick Ball_Object with Ball_Object.UID

    string variable_to_return = ""

    Do this and add UID of #1 found, surrounding Balls to variable_to_return

    Do this and add UID of #2 found, surrounding Balls to variable_to_return

    Do this and add UID of #3 found, surrounding Balls to variable_to_return

    Do this and add UID of #4 found, surrounding Balls to variable_to_return

    Do this and add UID of #5 found, surrounding Balls to variable_to_return

    Do this and add UID of #6 found, surrounding Balls to variable_to_return

    return variable_to_return

    }

    ------

    I really don't know why this is not working with a loop. Are there some engine limitations or is this intendet? Maybe a bug? Please can someone explain me whats going on?

  • Since i can't edit i have to add that i made a part of a workaround (which is garbage but hey it's something?)

    By pasting the whole object onto a drawing canvas behind the user media, then saving the image, using "on image saved" and setting a sprite to the SavedImageURL when using "Load image from URL" works to get the data into a sprite. I bet then its possible to store the SavedImage somehow into binary and then send over websocket???

    This is dirty and hell.

  • Yeah this is still relevant. I know this is a game engine first and 3D is super cool, but i think more stuff like this would be fantastic.

    I'm trying stuff with the User Media plugin and all works offline but i have no clue how to get the video into, i dont know: a canvas. Or in binary. Or in Json. Whatever?

    I would like to do a video/Audio chat together with my game.

    Since there seems no solution i hope this gets attention.

  • After watching it on youtube i was confused to upvote or to downvote it.

    Its such a stupid idea to post this great possible feature as an maybe april fools joke, that i feel mixed about this.

    Is it a cool feature? Yes. Was it a fun joke if its an april fool? No. If its true, was it wise to post it on first of april? No.

    So i dont know how to think about this. All i have now is hopes up for having simple 3D.

  • I've made a simple test programm with three buttons.

    Push Button 1, it connects and logs into the signaling server.

    Push Button 1 again, it discconnects from signaling server.

    Works fine.

    Button 2 should be a host.

    Push button 2, it joins/creates a room.

    Push button 2 again, it should leave the room.

    Now it does all that but i have a simple check that prints me every second some status texts for these four cases:

    Is host

    is in room

    Is connected to signaling server

    Is logged into signaling server

    So i can see if i'm still one of these things.

    First when not have done anything, Status shows me that i'm none of these 4 things. Then i connect to signaling and login and it tells me i am connected and logged in. I decide to host, join a room and i'm all of these 4. Then i use either the action "Diconnect" under "Room" of "Leave Room" under "Signaling" and it still tells me i'm host. Even when i'm connected to signaling or being not connected. I can try what i want but i still remain being a "host" now.

    Is this a bug or is this intended? When it's intended, how can i be not a host anymore without closing the game?

    This really bugs me out because i try what i can and events get messy because the events "Is host" and "Is not host" are then hard to use or get still triggered when i just want to be offline/not a host.

  • Hello!

    I have the same error when loading. How can I find the error?

    Thanks!

    Hey, i know this topic is old but the bug still exists and some might run into the same problems. I don't know why this is happening so i can't post a fix. But i found out, deleting all events that are triggered on 'On start of layout' and related to the action 'Destroy' an object, helped to remove this error for me when loading a game.

    I had objects wich were in the layout just because i need one instance of them at least in the Project. So i removed this objects from the layout and put them once in a blank 'All Objects Here' layout, instead of deleting object instances on start of layout.

    So check your event sheets for 'Destroy' actions, try to remove them. Don't know if disable them does the same.

  • I know. But in a single "Set text" , it doesn't work even without str().

    EDIT: Used "Set text" > 'Pulse_Tick_Heart & " - " & CurrentLanguage.Get("Env_Monitor_Heartbeat_Rate")' same strange result.

  • Hello all!

    I'm using Construct 3 for a while now and as a beginner i learned a lot. But i recently had a problem which i did not understand. So i made some screenshots and uploaded them on imgur.

    Link >> https://imgur.com/a/DvfB6H1

    ---

    Tl,dr: To make it short, i add 0.05 to a local static variable 'Pulse_Tick_Heart' and show them every 'Pulse_Tick_Heart'Seconds in an text object. I expected text shown like this:

    1 > 1.05 > 1.10 > 1.15 > 1.2 ... and so on.

    Somehow it does this:

    1 > 1.05 > 1.10 > 1.15000000000001 > 1.20000000000001 > 1.25000000000002 ...

    ---

    I just don't get why this happend? Used to calculate like this before and never got problems. Did i anything wrong? I'm so cunfused.

  • I don't know if this is related to this problem at all, but yes, i also can confirm strange behavior with the Multiplayer.PeerCount.

    I made a room lobby and show the Peercount in a text field. It shows 1 when only the host is connected. Which makes sense and also is described in the manual, that the host counts to the peerCount. When a peer joins my room the text shows 2 peercount. The problem now is that if i created a room with a max peercount of 1 a peer still could join and so, there are 2 peers in room.

    -A second and different problem occours later when i start the game and the layout changes to ingame (Also don't know if it is related, but maybe it can help).

    The host show a 'Assertion Error' which seems to be related to the 'Multiplayer.PeerState(PeerID,"")'. It always pops up for the host and when i disable all Peer states no error accours.

    The error was: Assertion Error: Calling expvalue.set_float without number type (Function asset2)

    Seems the variable 'val' is undefinded but the parameter with the peerID of Multiplayer.PeerState was set to 'Self.Peer_ID' in which i store a peers id on start of the layout.

    But maybe im missing something there.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This explains a lot. Just a beginner here, trying since weeks to kick peers from room. Server kicked the peer but can confirm that "On kicked" is never triggered. Looked in the manual but seemed i did nothing wrong. Then i found this thread here. Will try a workaround but would still be great fixing this.

Krapfenmann's avatar

Krapfenmann

Member since 13 Apr, 2018

None one is following Krapfenmann yet!

Trophy Case

  • 6-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

8/44
How to earn trophies