Rable's Recent Forum Activity

  • Hi,

    I try to have correct placement of text objects but can't manage to make it work properly. My problem is that depending on the browser, the same text will appear differently.

    Here is an image

    And in Opera, the text is much lower than in Chrome

    As you see, the result in Chrome is good, but it's bad in Firefox. The given example uses the Google Font "Roboto". Changing the Horizontal or vertical allignment or hotspot doesn't help?

    Is there any solution to be more precise while using the Text object, or should I go back to sprite fonts?

    Thanks!

  • Hi everyone,

    I'm currently designing a game for which I need to put an online database with highscores. Thanks to ArcadEd 's excellent tutorial, everything went smoothly, but now I face another problem.

    The game exports scores to the database at the end of every level. This means that if you scored 600 points in level 1 and 700 in level 2, your total score will be 1300. However, as the score is send at the end of every level, this single session will export scores of 600 and 1300 for this player. This is problematic because of course I want only one score to be send per game session, not one per level!

    Is there a way to avoid this?

    One way I thought about doing this is to create a random (long) string of characters and add this to the database under "sessionID" so that each session correspond to a single ID and the score is sent to the same place of the database, thus avoiding multiple scores to be send from the same game.

    Is there a better way to do this that you can think of?

    If not... well I have troubles creating this random string of characters (it should use most ascii characters). I should probably make a loop and append a random character at the end of a variable, but is there any way easier to select any random character than having a random number between 33 and 126 and extracting the character corresponding to this ascii code?

    Not exactly sure how to translate this into Construct 2 either... Or maybe is there any string generator out there in the plug ins?

    Thanks for any help!

  • EDIT : by analysing your capx I've been able to solve the problem! I previously defined the "char" values in each object's properties in the layout. Despite the fact that the values were correct in the debugger, defining all the values on the start of layout like you did fixed the problem.

    Curious, as doing the same in your capx actually works... I should have missed something here.

    Anyway, thanks a lot!

    ---------------------------

    Hi LittleStain and thanks for the answer.

    • The event is triggered once every few seconds
    • "Do something" is normally a function reducing the character's life, but for test purpose, the knight action just says "delete knight", the archer action is "delete archer" etc... Just to be sure it is triggered or not, and it doesn't.
    • Given the "do something" is just delete the object and that it these objects are never created in the event sheet (they are present on the layout)
  • Hello,

    This is a pretty basic thing I am trying to achieve. Still, I can't manage to do it properly. I even thought about posting it in beginner's questions forum but well...

    So I have a family "allies" with 4 object in it : "knight", "berserker", "archer" and "sorcerer". There is a "char" family instance variable, and I defined it to the exact name of the object. So to be clear the "knight" object's "char" variable is defined to "knight", and same for the 3 other objects.

    Now all I want to do is select one of the alive allies at random and know its char value in order to apply a function to him.

    I do :

    Allies health > 0 ("health" is another family instance variable of course)

    (in a subevent) Pick a random allies instance (up to there everything is working fine, I have checked in the debugger)

    (subevents of the previous subevent) Allies char = "knight" --> do something

    Allies char = "berserker" --> do something

    Allies char = "archer" --> do something

    Allies char = "sorcerer" --> do something

    If I'm correct, the "do something" part should apply only to the instance picked at random, but it actually never triggers, for none of the allies.

    Any idea of what I am doing wrong and how I could fix it?

    Thanks in advance!

  • Thanks a lot for sharing. A quick question, does the skew effect requires WebGL?

  • Oh, sorry, I just forgot to add the 4 image points! I was to enthusiastic to take the time to place them. ^^'

    I'll try again and I'm sure it will work this time.

    Thanks!

    Edit :

    Wow, it's working perfectly now! Thanks a LOT R0J0hound , without your code I would have had to use a completely different (and lesser) solution.

    Thanks a lot to rexrainbow too, of course, for the original moveto behavior!

  • [Discussion is getting a bit out of the Moveto Behavior's scope. If that's a problem I'll post this thread in another place]

    R0J0hound

    Wow, this seem to be just what I need! I implemented your code in the game's code, but up to now I didn't manage to get the same result as in your capx... I don't understand very much what's happening, but deleting the "solid" and "pushOutSolid" behaviors and replacing them with your code (updating the player and wall objects with mine, of course) let the player pass through the walls.

    I tried to change the 16 value that you suggested to change, it behaves differently but not really better, being stopped by the walls but "jumping" from one palce to another.

    Any idea of what's happening? Any advice on how to implement your clever code into my game's code?

    Here is the capx of this part of the game :

    https://www.dropbox.com/sh/j9hoth2oty56 ... tKYWa?dl=0

  • rexrainbow

    Thanks for these awesome plugins. Up to now, MoveTo is the best solution I found for making my character move on the world map, used in pair with PushOutSolids.

    However, I still get strange behavior in certain situation, and I thought that I could show you what it is in case you would like to update the behavior.

    Here is an animated gif of the problem :

    http://giphy.com/gifs/3o85xFKfz2HmfuBMCQ

    I think the problem is clear but to explain it further, I just click once just before the character starts walking. At first he goes to the point I clicked... Until he colides with a solid. At that moment he suddenly starts walking around the solid but in the wrong direction (top instead of bottom). I encounter this problem very often, and I'm afraid I won't be able to use your behavior if I cant' find a way around that problem...

    To make things even more clear, here is the same situation with solids visible and colored :

    http://giphy.com/gifs/3oEduGqATSWgHh1JHW

    Is there a way to avoid this problem and to make him move nicely in the correct direction?

    Thanks!

  • Works perfectly now, thanks a lot!

    And here is the final effect. <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    http://giphy.com/gifs/game-healers-ques ... 1qhQp5sa4g

  • Indeed, I use Z-order now (move to object) and it seems simpler. thanks for the tip!

    However, it still doesn't work and I guess I know why. I simplified the code, saying that there was one object but there is actually more objects turning at the same time. 6 of them most of the time.

    But actually I need to use "compare two values" to be able to check the value of the sine (I don't think it's available in the object condition), so my guess is that maybe the correct instance is not selected when I'm asking to check the sine's value.

    In other words, does "compare two values" select only the object instance which conditions are met within it, or doesn't it select anything at all?

    If it selects nothing, any way I could achieve what I want to do (i.e. changing the z-order of the object instance(s) which sine's value is close to their max value)?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I'm trying to achieve an effect where a little object will turn around another object (in false 3D). To do this I put an horizontal sine, a slight vertical sine (same period), and Im trying to change the moving object's layer based on the value of the horizontal sine. Here is what my code looks like :

    for an amplitude of 100

    object.sine.value <-99 set object to layer 0

    object.sine.value >99 set object to layer 2

    Of course my other object is on layer 1, so the first one should "turn" around it.

    It seems pretty straightforward but the result is not convincing at all. Actually the moving object often passes 2 times before the other one, sometimes it switches layer in the middle of the movement.

    I also tried to change the layer based on X value of the moving object, but the result is not better.

    Am I missing something with the way sine's value works?

    Thanks in advance!

  • EDIT : adding the "Start animation from beginning" action solves this problem. Just discovered this one.

    Hi,

    I've got a little problem with animations. I've divided my main characters into 17 layers in order to have a customizable character.

    So I created functions to launch the right animation for each layer at the same time. It's working fine BUT for some reason, on certain animations, the current animation can't be interrupted by launching the same animation. In other words, if I launch an animation and launch the same animation while it's running, the first animation will finish, and the second one, triggered while the first one was playing, will not be displayed at all.

    However, all animations can be interrupted by other animation without problems.

    And I double-checked that the "set animation to" actions are always set to "play from the beginning". Any idea of what may cause this?

    Thanks!

Rable's avatar

Rable

Member since 6 Aug, 2014

None one is following Rable yet!

Connect with Rable

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies