graham-s's Forum Posts

  • I'm looking to pick a sprite just by UID, not by selecting the sprite first.

    Synopsis: I have a platformer which has objects in a room. As I pick up an object, I destroy it and keep track of the UID in an array. These objects differ. Eg: SpriteCoin, SpriteDiamond, SpriteDoor

    When I go to another room(layout) I am reading the array and trying to remove the entries with the UID since they were picked up before.

    Eg: Picked 3 items in the room. Item stored in Array(room#,Object.UID) as 1

    Come back to room.

    Loop through XY array

    If array(Current Room#, array.YCur) = 1

    UIDofSpriteToDestroy = array.Ycur

    Destroy Sprite UIDofSpriteToDestroy

    In searching the forums/FAQ/tutorials I see several example of picking by UID, but my understanding is that you know what sprite it is.

    Can anybody provide insight?

    Thanks.

  • An actual realtime update would prove problematic as you would need the app to automatically refresh every X seconds. This would a) Use a persons data and b) deplete mobile power. Ultimately who would want their restaurant app to be updating every 30 seconds. I wouldn't think that the realtime value is there for it. Waiting for a table, perhaps.

    A better option would be to a) pull data as you load the screen, and/or b) provide a 'refresh' button.

    As to whether the data changed, you can timestamp a last update (Eg: Restaurant 1234 last update)

    Data as indicated previously needs to be handled remotely, or pulled remotely and held locally.

    So, once you design your database, it would be...

    1) 'List restaurants'

    2) On restaurant selection> Load restaurant data

    3) Present restaurant data

    4) On refresh > Check last update > If newer Load Restaurant data. (Would save on data)

    As an addendum, as the app regains focus, you can always go and reload the list/restaurant again to keep it current.

    Some thoughts to play with.

  • You do not have permission to view this post

  • Thank you blackhornet,

    Jiggled it about a bit, and now it looks like this and works as intended. Appreciate the time and solution.

    Graham.

  • I've been struggling with this for a couple of days now, and while I continue to work through it I thought I'd see if anyone can provide some guidance.

    Synopsis: I have an array, that holds 4 pieces of information.

    a) Room. b) Door #. c) Destination Room. d) Destination Door.

    There are 61 entries in the array including row 0 with titles.

    The final result is that I want to go to the layout of destination room, and position the player at the destination door. Likely via a call with the parameter of room/door.

    The room and door # are known by a global variable for room, and an instance variable for the door. (RoomNumber and ExitDoor.DoorNumber)

    The screenshots attached are the contents of the array, the event sheet and the output (showing that I was able to extract some of the data, but have failed to be able select a certain Room/Door record. I feel I'm close but not close enough.

    ** NOTE: The last two lines do NOT work, it doesn't find the matching entry.

    This is the contents of the array.

    The event sheet and the output.

    Thoughts, input or solutions?

    Thanks.

    Graham.

  • I thought I'd take a minute to post my observations on Construct (3). I'm a new user of Construct, but not a new developer. This list was just a way to get some thoughts down on my experience, that may or may not instil further discussion on how I may better use the product.

    For reference, I am using a Mac running High Sierra, and I have purchased a Personal license.

    Browsers aren't the most stable of products.

    Out of the 3 Mac browsers, Chrome seems the most stable, Safari second and Firefox third.

    Construct is far more powerful than it looks once you poke about under the hood.

    The tutorials that are available are quite helpful.

    The people that help in the forums do a great job of including .capx files to help people. It helps others when we come looking.

    > Its a shame a lot of people used dropbox and their links are now broken. (This may be due to the changes in 'public' a couple of years ago)

    Construct has its idiosyncrasies, but these are largely my lack of knowledge. I spend a lot of time trying to figure out where I can and cannot use 'Else'

    Visual layout is great. In other languages I spend ages changing X/Y positions to get something just right.

    I Loved that I could write a proof of concept Pacman and Space Invaders in an hour or so.

    Remote Preview seems hit and miss depending on what browser you use.

    Recipients of remote preview had mixed success too

    Had some concerning issues with touch on IOS. If you close Safari, THEN run the remote preview app, touch wouldn't work. I was able to reproduce on multiple units, but not how to fix it. Could have been my code, but I'm too new to know.

    I like writing business apps, I don't think that Construct is the tool for that, it can do a number of the GUI tasks, but while I haven't tried yet, I suspect I'll use other languages for that. (Using SQL without PHP for one).

    Finding rational descriptions of activities is difficult. There are many tutorials that say how to do something, but not how something works. (I had a sprite that had a square polygon and hit a square wall. It slowly moves upwards as it went left and right. I couldn't figure out why, so I just set the Y every tick to the same.

    Since I'm the other side of the pond in North America, I do find some occasional latency with the Scirra site (Forums) and lack of responsiveness. I shall take that as being a spoiled developer and having most other sites I frequent be on this side of the pond. That said, its not unusable just annoying when you need it.

    Overall, I'm happy and excited with my purchase[license] of Construct 3, now to be able to make enough $ off an app to pay for it

    Well there you have it, a long rambling list.

    Have s super day.

  • Ah, finally found it.

    For others searching...

    You have to add a new file in the FILES directory in your project, from there you can open the editors.

  • Just went through 3 browsers again, but I don't see this as an option.

    Even via the project bar, if I click or double click the Array or dictionary objects, I don't get anything occurring.

    (On a Mac)

  • OK, same question but for the Mac!

    I'm positive that I've seen it before, but can't seem to find it now.

  • Oh, those are stupendous responses! You both totally nailed it, and boy it's a *LOT* simpler than I was going to make it.

    Thank you, that's a keeper. Gold Star to you both.

    Problem Solved.

  • I haven't done this with construct, however on other platforms it can be done by storing a file.

    When you're app runs the first time, you can check for a file (eg: firstrun.txt). If it doesn't find it, then it's the first time that it was run since installed. As soon as it has been run, you write the file out with 1 byte (Eg: 'Y').

    The next time the app runs, when you check for the file, and it will exist, so you skip the tutorial bit.

    This way, in options, if you want you can give the option 're-enable tutorial' and just delete the file so the tutorial runs next time.

  • Hi folks, quite new to Construct(3), but not a new developer.

    I'm trying to figure out a good way to handle keys and doors in Construct. Here's a scenario.

    I have 5 keys and 5 doors. Each key opens the relative # door. Eg: Key 1 opens Door 1, Key 2-Door 2 etc.

    If I walk over a key (eg:1) I pick it up. If I'm holding a key the original key gets replaced on the screen in the original spot.

    Heres a quick 'action list'.

    Player hits key 1, picks it up (Key 1 disappears from screen). Player is holding key 1.

    Player hits key 3, Key 1 shows back in its spot. key 3 disappears from the screen and player is holding key 3.

    Player hits key 4, Key 3 shows back in its spot. key 4 disappears from the screen and player is holding key 4.

    Player opens door 4. Key (and door) 4 are now destroyed, player is holding NO key. Key 4 will not be displayed again.

    -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----

    Since the graphic of each key/door are different, they aren't instances. (I decided that wasn't prudent since the keys are numbered) they are all separate objects. Door1, Door2, Key1, Key2. This can be changed if needed.

    In pseudo code, I think its something like this...

    If Player collides with Key

    If Key(KeyHeld Variable).destroyed = False. -- Only show the held key if it wasn't destroyed

    Key(KeyHeld Variable).Visible = true. -- Re-Show the old key back in it's spot.

    End

    KeyHeld.Variable = Key.KeyNumber. -- Update key held to the key we just hit.

    Key(KeyHeld Variable).Visible = false. -- Hide the key onscreen that we hit.

    end

    If Player collides with a door

    If DoorNumber = KeyHeld Variable. -- If the key matches the door

    Destroy DoorNumber -- Remove the door

    Destroy Key(KeyHeld Variable) -- Destroy the key object based on the variable held

    KeyHeld Variable = 0 -- Reset the variable since we're not actually holding a key

    end

    end

    __________________________________________________________________

    Based on the pseudo code, I'm not sure how in construct to nest the checks of keys 1-5 (I actually have 8).

    I also believe I can't use Key(KeyHeld Variable) either. I couldn't figure out how to easily link a variable to an object even after several forum/google sessions.

    I hope there is enough and not too much info on the post, I'd appreciate any input for this construct NooB!

    Thank you.

  • The demo link is broken, can we get an updated link so we can check it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'd suggest looking at a SQL database. That way you can search/select quite easily.

  • Hey guys, Im a new developer, Ive never finished a game before but I have learned code in a beginners course of visual basic. Any advice?

    Start small.

    Write yourself a few little apps to get the hang of things.

    When you go to write the app you really want, plan it out first. Define the scope otherwise it may run away on you