Guizmus's Recent Forum Activity

  • Could you show us the Boolean try ? It is the way to go here, it works, based on what you had (I tried ^^). With your try, we could tell you where you made a mistake.

  • You should take a look at the Templates, especially the "Endless runner" one. Templates are in the File->New menu in C2, after the common project configurations.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yann Typecasting ? Thanks for this one, I was still calling a custom function with familyObject.UID, and then selecting the specificObject by its UID in the function.

    PS : As I didn't understand right away, I made it as an example in attachment.

    Blue and Black are in the family "movable", Red is not.

    Blue has a "speed" variable, and black has "hp". On collision, depending on the object colliding, the corresponding action will be called.

  • You should take a look at their documentation on the C2 API.

    Here is the part on leaderboards :

    [quote:2az2vcv0]In Construct 2

    Actions

    Post Leaderboard Score

    Name is optional, if specified, it will show up next to the score. If not specified, Clay.io will ask the player for his or her name

    Score should be set to whichever variable (expression) you have the score stored to

    Leaderboard ID is what you were given after creating the leaderboard on Clay.io

    Post Encrypted Leaderboard Score

    This requires a backend for your game, but you can have more secure high scores by sending an encoded JWT (JSON Web Token) that specifies the score. See http://clay.io/docs/encryption for further details

    Show Leaderboard

    Leaderboard ID is what you were given after creating the leaderboard on Clay.io

    Time Frame is how far back in time you want to grab scores from

    High Score can be set to individual (a single score per time they post a score), cumulative (each time they post a score it is added to their total score), or best (only use the best score from each player)

    Sort is for the order of scores. Descending is highest to lowest, ascending is lowest to highest

    Scores From can be All (scores from everyone who has played the game), Personal (just the current player's scores) or Friends (just the player's Clay.io and Facebook friends' scores)

    Fetch Leaderboard

    If you would like a more customized-looking score table, you can fetch the list of high scores and loop through them using a System -> For loop from 0 to Clayio.LeaderboardScoreCount. The options to fill in are identical to above

    Hide Leaderboard

    The leaderboard already has a close button and closing it is bound to the "esc" key, but you can also close it with this action

    Conditions

    Leaderboard Score Posted

    This is called when a score is successfully posted to Clay.io. A good use for this condition is to display the leaderboard immediately after the score is posted.

    Leaderboard Scores Fetched

    This is called using the event "Fetch Leaderboard Scores" when they are successfully fetched

    Expressions

    LeaderboardScoreCount

    The number of scores fetched using "Fetch Leaderboard Scores"

    LeaderboardName

    Use this in conjunction with a System -> For loop from 0 to Clayio.LeaderboardScoreCount to fetch high score names - it will look like this: Clayio.LeaderboardName(loopindex)

    LeaderboardScore

    Use this in conjunction with a System -> For loop from 0 to Clayio.LeaderboardScoreCount to fetch high score numeric scores - it will look like this: Clayio.LeaderboardScore(loopindex)

    LeaderboardScoreMe

    Use this in conjunction with a System -> For loop from 0 to Clayio.LeaderboardScoreCount to fetch high scores. Returns 1 if the current score was posted by the current player, 0 otherwise - it will look like this: Clayio.LeaderboardScoreMe(loopindex)

    LeaderboardRank

    Either the rank the player just achieved - or their highest rank if their score wasn't just posted (when using "Fetch Leaderboard Scores")

    LeaderboardRankName

    The name of the player playing (when using "Fetch Leaderboard Scores")

    LeaderboardRankScore

    The score the player just achieved - or their highest rank if their score wasn't just posted (when using "Fetch Leaderboard Scores")

  • Well, first of all, event with an html element handled in C2, you may have problem, as the like counter and button is an iframe, and is handled by facebook. When you add such a box in a webpage, you add the element, and facebook does the rest : check for connection from user (to display if he already likes), collect the page's meta if it wasn't in cache, ... And the clicks are also handled by facebook. So it doesn't seem fitting to put the like button INSIDE C2. Why do you want them inside ? What do you want to do with them ? Even if you successfully have the iframe element created inside C2, you won't have the onclicks, so it seems like a

    Subscribe to Construct videos now

    .

  • There are ways to do this.

    First, you can add a display:none on your <canvas> in the php/html directly. This way it won't be displayed at first.

    Then, in C2, add an event "On start of layout" with the action "ExecJS" from the Browser object. This way, you can call a function that you declared on the page.

    Be careful though, read the manual concerning ExecJS, as there are security issues. If possible, don't use it at all.

  • The tooltip is an HTML property that you won't be able to change, not its behavior at least.

    If this behavior doesn't fit you, you should then try to replicate it. Each textBox could be put in a container with a text/spritefont object, so when one is created/destroyed, so is the other. The text would be used as a tooltip then, you just have to position it. You can also add a 9patch in the container to make a background for this tooltip. Then, all you have to add is display/hide the text/BG depending if the textBox is focused or not.

  • I made a tutorial explaining and building a dialog system. The example that goes with it is more or less a simple text adventure with multiple choices, like you described. Here, take a look.

    But like Teacherpeter said, you are looking for something quite basic, so this solution might be too big for your need. If so, you should start by doing more tutorials maybe.

  • I tried to use C2 programs, inserted using userscripts, inside a page I didn't host, to add functionality to a browser game. I had to trade some data between C2 and the webpage. I used a "notification system" to dialog between the two, meaning :

    • each time the JS needed to send data to C2, it would store a request (see below) in an array, using a function "sendNotification".
    • a request was a string with a C2 function name (function meaning the Function plugin), and arguments, separated with a "__".
    • each tick, C2 would execute a code "getNotification()" with execJS, and would be returned the string of the first waiting request, with a "this.lastRequest" evaluation like R0j0 explained. The request was then analysed and the correct function was called with the correct arguments in C2, handling the request (depending on type of request, like update life, ...)
    • the other way was quite simple, as you can just execJS the functions you want in the webpage from C2.

    This was for intensive exchanges, but the method can be used in other ways, including simple ones. (2 C2 games running on the same page, chatting with each other ?)

  • If I was wrong, go over the Bug forum, providing one of those .zip not working.

    Don't need to write like that if you need help, it won't help, And it can be taken to be rude...

  • QuincyDK

    Hey, sorry I wasn't of more help either to your problem in the other post. What you just said made me ask myself : are those static data ? If so, the problem isn't the same. Executing code through execJS won't be a problem as it will only be for development. Once you've got the static data loaded in you array(s), you can use the "download" action to get there content as a C2 formated JSON file, that you will then be able to use in replacement of the execJS, for the real game.

  • In the last project you shared, the variable is an instance variable on the objects "light", and its name is ... "color".

    As for other solutions, no I don't. I ran into the same exact problem (top down, stealth game), and used another light system, a lot less attractive (no light around corners possible at all, light was going only on X and Y axis...). It won't be your solution.

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies