Toby R's Forum Posts

  • Why not just save the active UID to some global variable (let's call it activeWeapon)? Now whenever you need to read or save data from/to instance variables you simply pick by UID and do whatever is needed.

  • Ashley what do you think about that change?

  • Thanks gumshoe2029 for your reply. AJAX communication is just user<->server and it is very slow comparing to WebRTC and it is WebRTC (C2 Multiplayer object) I mean here.

    So I don't want to save the game state but do the real time multiplayer game. The point is that with Multiplayer object in C2 you sync C2 objects data, so I just was wondering how pros are doing this. Theoretically it is possible to split host and peer code, but due to the architecture I'm just wondering if it's not gonna be pain during development in further phase. So not sure if it's a good or bad idea.

    Haven't had time to play with it yet really.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Could you edit your links and remove "https://www.scirra.com" part?

  • Again I came to the point where my eyes struggles finding an object in the project tab

    This is how it looks when you start to try make it ordered:

    So once we have a lot of objects and directories it starts to look messy. On this pic is not that bad yet, but it will get worse with every new feature/new objects/more directories.

    If the directory names would be simply bolded I believe it would be way more readable. What do you think guys?

    EDIT: same goes for layouts and event sheets.

  • Potato23 can you show some of your work? Graphic portfolio or games you made graphic for?

  • You can make a loop with number of iterations equal to the number of frames, then on every iteration spawn an instance of your sprite object, now simply adjust the position and set the frame to be equal to the loopindex.

  • Awwkay... I got it. My Character is in container with another sprite (his gun), and that gun sprite was not global, that's why I had such a wierd situation.

    I made gun sprite global as well, and it works fine now... duh!

  • Yes I'm sure. I've checked that like ten times. Darn that should be trivial and I stuck with it for a pretty long time now huh.

  • Hi ppl,

    I have a character (sprite) which is my player. When player walks into some "doors" he should be transported to the next layout (level) and be able to back to previous one layout (level).

    Sounds trivial, but... this character (sprite) has several instance values like healthPoints etc. No matter what I try I can't get the instance variables to persist.

    What I have tried:

    1. Add persist behaviour to the object - It doesn't work, but that's understandable cause Persist behaviour remembers the state of the object instance for the particular layout.

    2. Set "playersLayer" to global and player object to global - in result object is automatically (no need to add it manually) created on the layout with the initial state of the instance variables. Well I thought "global" moves the instance to the next layout so I would expect to keep the instance variables unchanged... but not

    3. Allright so I've tried to set layer and character object to global AND add a persist behaviour hoping maybe this will keep the instanca variables set up... but again failure.

    I think I am missing something right? Do I really need to save those values somewhere in a dictionary or so and then load it after layout switch or there is a smart way to move The Player in one piece all over the layouts?

  • For your solution you can add a boolean instanca variable which determine if exp already got calculated or not... BUT checking all enemies all the time just for calculating exp points seems to be like a connon for a fly.

    Each enemy/target should have an instance variable "health", then

    On BULLET collision with TARGET

    • decrease TARGETs health points
    • if TARGETs health points <= 0

    -- run "dead" animation

    -- calculate XP

    Something like that should work, if it doesn't, just give us a screenshot cause there is something else giving you problem.

  • Me and small group of friends are launching social media profiles and a webpage for our projects and prototypes very soon. Maybe even today . Once it's done I'll let you know!

  • Yup, after deleting cookies everything works fine.

  • I'm about to play around with Multiplayer object. I read the tutorials etc. But all tutorials are based on client(peer) and server(host) code as one project.

    Isn't that dangerous to give client the hosts code? I'm just wondering what is the good practice in multi user games where host gonna be run 24/7 on separate server anyway.

    Is it a good practice to make separate projects for host and peer in C2?

  • When I try to enter any tutorial I get the following error:

    [quote:yiekjlml]Server Error in '/' Application.

    An item with the same key has already been added.

    I try to access it from the mobile Chrome browser, but it looks like a server issue.

    Does anyone have the same problem?