tulamide's Recent Forum Activity

  • Thank you :)

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

    I just downloaded the 'Verve!' example and wanted to point out a couple of things:

    1, The intro screen (Press any key) doesn't tell you what what the game is about, or what you have to do ?

    2, When the main game starts all i can see is what appears to be a torch or light beam, but i havent a clue what i should do next?

    3, The main game screen is virtually black(on my system)

    4, I tried adjusting the brightness and contrast, but it didnt make any difference

    Hi chrisbrobs,

    1, I didn't expect that the game would need any instructions, and I focused on the events rather. I agree, it should do so. I will extend the start screen with the possibility to view instructions, and will be using it to introduce yet another of CC's helpful programming options ;)

    2, will hopefully be no issue when the instructions are implemented.

    3, It is intended to be so. You will recognize that the light will change over time from near black to dark red, to reveal a bit more of the scene. If it doesn't fade back and forth between those two colors, please tell me so.

    4, that's good news :D No, really, the interesting part of that example is that you need to drive carefully to not bump into the obstacles. But again, I want to stress that it wasn't the game itself that serves as an example, but the events and the techniques used, independent of the game itself.

  • + MouseKeyboard: Right mouse button is down
    -> System: Set global variable 'angle' to angle(bone1.X, bone1.Y, bone1.ImagePointX("point"), bone1.ImagePointY("point"))
    -> System: Set global variable 'distance' to distance(bone1.X, bone1.Y, bone1.ImagePointX("point"), bone1.ImagePointY("point"))
    -> bone1: Set position to bone1.ImagePointX("point") - cos(global('angle') + 1) * global('distance'), bone1.ImagePointY("point") - sin(global('angle') + 1) * global('distance')
    -> bone1: Set angle to (angle(bone1.X, bone1.Y, bone1.ImagePointX("point"), bone1.ImagePointY("point")) + 1)

    This is wrong. Replace it with this:

    + MouseKeyboard: Right mouse button is down
    -> System: Set global variable 'angle' to angle(bone1.ImagePointX("point"), bone1.ImagePointY("point"), bone1.X, bone1.Y)
    -> System: Set global variable 'distance' to distance(bone1.X, bone1.Y, bone1.ImagePointX("point"), bone1.ImagePointY("point"))
    -> bone1: Set position to bone1.ImagePointX("point") + cos(global('angle') + 1) * global('distance'), bone1.ImagePointY("point") + sin(global('angle') + 1) * global('distance')
    -> bone1: Set angle to.angle + 1 

    Explanation: To rotate a point p2 around another point p1, you use

    p2.X = p1.X + cos(angle) * radius

    p2.Y = p1.Y + sin(angle) * radius

    You get the angle for the rotation by using the angle expression starting with the point, where you want to rotate around (in this case the image point), and ending with the point that will be rotated (in this case the hotspot)

    angle(bone1.ImagePointX("point"), bone1.ImagePointY("point"), bone1.X, bone1.Y)

    Now we need to raise or lower the angle value (to actually rotate either clockwise or counter-clockwise). The value you use, will be needed to set the angle of the object, too. In this case, it is +1, but if you'd prefer a timebased rotation, it could well be something like 90*TimeDelta, then you'd do .angle + 90 * TimeDelta as well.

    Now you need to set the angle of the object relative to the rotation. In this case, the rotation was by 1, so you add 1 to the current angle.

  • sved

    Thank you very much, it is not that I'm fishing for compliments. I just need some kind of feedback. For the platform issue it won't help, I'm afraid, as it isn't a platformer ;)

    scidave

    Thank you. I know you wanted to encourage me, but compared to what you experienced, I just feel so small right now. Like screaming before the doctor even touched you :D

    Maybe I shouldn't have posted this, but, well, I'm someone who needs feedback. It doesn't matter if it is criticism or approval, just a reaction is fine. When there is nothing, you are so insecure...and I hate that :)

  • //object1.X <> ScrollX//

    set object1. X

        lerp(object1.x, destinationX, x*TimeDelta)

    set ScrollX

        lerp(ScrollX, destinationX, x*TimeDelta)

    How do I change x*TimeDelta for both objects so that no matter how different their X coords are, they'll still end in the same X at the same time?

    Please help?

    Don't think too complicated.

    So you want two objects with different distances to destinationX to reach that point at the same time. lerp is perfect for that, because wherever you start, as soon as the t-value reaches 1, both will be at destinationX. All you need to do is raising the t-value from 0 to 1 over the period of time you want.

    If you want a number to grow over time, you add n * timedelta to it. The maximum value of t is 1.0. How long do you want it last until 1.0 is reached? 'n * timedelta' equals 'amount per second'

    To have it last 2 seconds, you'd add 0.5 * timedelta (2 * 0.5 = 1)

    To have it last 5 seconds, you'd add 0.2 * timedelta (5 * 0.2 = 1)

    etc.

    + some condition

    -> myT = myT + 0.5 * TimeDelta

    -> lerp(object1.x, destinationX, myT)

    -> lerp(ScrollX, destinationX, myT)

    Just make sure, myT isn't raised anymore, after 1.0 is reached.

  • 321 downloads so far - and no comment for 7 month now.

    I guess it isn't as helpful as I thought <img src="smileys/smiley17.gif" border="0" align="middle" />

  • You wouldn't need something special for that. Just outsource your graphic/sound/music files and load them as needed while running the game. Then use an installer package and make sure to make an registry entry with the path to the game's data folder on cd/dvd. When starting the game from harddisc (where only the exe would be installed) you game uses the registry object to access the path information and load the data from there.

    Or if your installer package is able to create an ini file, just store the path in an ini file and use the ini-object to retrieve the path information.

  • wait

    That I've found is next to useless, it constantly caused errors in

    the event hierarchy because it would re-check the above variables

    after the time had passed instead of only causing a delay before the

    next action occurred.

    For example, if you had it check if a private variable were equal to 0

    before running some events, one of which would need to change that variable

    to 1, when it reached the next action after waiting maybe 200 milliseconds,

    the events condition wouldn't be valid anymore and it won't occur.

    I am no friend of the wait object, because it makes event sheets harder to maintain. That's why I never use it. I just proposed it, because quite a few people here swear on it, and I didn't want to hide it ;)

    timer

    that's what I've had to use for objects so far, but it becomes an issue

    very easily.

    #1 if there is more than one object on the screen (if it's an enemy in which multiple enemies would be created, you couldn't get a timer to

    start on individual enemies without it occurring on others. For some objects that I have destroy after a certain amount of time, even if there are multiple you can use that timer by only setting the timer

    when a condition that a variable is equal to 0 is met, then change that

    to 1 after the timer is set in the same event. But that only works because you only need to use the timer once and it's an event based off the objects creation.

    I'm not quite sure if I understand. PVs are unique to every instance, it is just a case of picking right. If I pick one instance and set 'timestamp' to timer, only 'timestamp' of that one instance is set. So, if you want to pick an instance at times, when it is not created, you can do so by picking based on oid or uid, or set an 'pid'-pv on creation.

    For a situation, where one object would have to spawn a few instances delayed, there are objects like array or hash table, where you could store the timestamps, test against timer and clear/remove the cells, when creating the corresponding instance. Straightforward and easy to control :)

    #2 if you want multiple areas of an object to be based off time, it'd very easily become a large hassle and difficult to manage if you kept having to create private variables and setting them to time and checking them.

    I can't agree here. I use the 'timestamp' method in every project, sometimes on hundreds of sprites and instances. If you carefully prepare your project, you won't get into trouble. Instead, while using something like the wait object would really be a problem under such conditions, it is relatively easy to follow the logic behind the 'timestamp'-events.

    The reason I want some events to not be affected by timescale, is I want

    to slow down the world by using timescale (all events/objects/etc), however

    some things I don't want to slow down, for example how long a text object

    spawned off an enemy displaying the damage they have taken would last

    before being destroyed.

    I see. Well, this is a situation, where you have to decide, which one is more important to be time-based.

    You could, for example, constantly check the framerate (e.g. through getting the mean of 1/TimeDelta) while timescale = 1. Then, when reducing timescale, you'd calculate the proper timing for the text boxes based on that framerate, and alter them tick-based until timescale = 1 again.

    Or you could leave timescale untouched and slow the world down by changing all the timebased values, including animation speed, etc. But that would mean a huge effort to make.

    I recommend to download Verve!, an example game that is completely time-based. There are a lot of the things realized that you are thinking of (For example, there's a commented volume fade over time, although timescale=0 at that time). I commented every single event, so it should be a good source of information.

  • Arima described TimeDelta perfectly, which should help you get started with time-based developing.

    Just make sure, you stick to one method, either time based or pixel based. Trying to combine those will only give you headaches.

    If timedelta is FPS independent, how do I do something simple like I would

    with ticks, where I want to make an object after 100 ticks,

    an amount of time that would be consistent across varying framerates?f working time-based, you have to remember that the shortest interval you have still is one tick. If your game runs at 60 fps v-synced, the fastest your code is triggered is every 16.67 ms (1/60). Every time-based condition will trigger either exactly at the given time or as close as possible to it afterwards. For example, every 1 milliseconds will trigger at tick 1, tick 2, tick 3, etc., because the game doesn't run at 1000fps (which would be needed for 1ms).

    To have an object being created after a certain amount of time, there are several methods:

    • You could use the wait object, delaying the creation
    • You could use timer (a system expression). Set a variable 'timestamp' to timer, and compare 'timestamp' against timer and the desired timespan. For example, to create an object 2 seconds after 'timestamp' was set to timer:+ 'timestamp' less or equal timer - 2000

    + Trigger once

    • You could use the timeline object

    Also from what I understand, if TimeDelta becomes necessary to swap with

    all my events currently using ticks, what would be the best way to have

    things consistent in their time when I'm using timescale? Have seperate

    trees with different times set based on the timescale at the time?hat confuses me. The whole purpose of timescale is to have an easy way to change the timing behavior of all time-based code at once. So why would you want to change timescale, without wanting to change the behavior of the time-based code?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here is another one:

    Automatically loop-count x from 1 to n repeatedly

    x = (x % n) + 1

    EDIT:

    In C2 it says

     Type mismatch
    = does not work with 'integer' and 'string' (use & to build strings)

    In CC it works when the testvar is a number, e.g.

    Text: Set text to global('test') = 0 ? "Value is zero" : "Value is non-zero"
  • That would be awesome!

    In the meantime, while you are optimizing your current plugins, I will start teaching myself javascript and test my capabilities. Kyatrics online version of the C2 SDK documentation is very useful, and from what I see it seems to be a straightforward adaptation of the C++ SDK for CC, so it shouldn't be too difficult.

    Then again, learning is much harder as you get older... :D

  • The size of the exported .exe grows with the assets and plugins you include (e.g. the physics behavior needs about 2 MB, a large 512x512 texture needs 1 MB, etc.).

    With this in mind, you could try to use smaller textures, less animation frames, or omit behaviors, if the same effect could be achieved with just a few events.

tulamide's avatar

tulamide

Member since 11 Sep, 2009

Twitter
tulamide has 3 followers

Trophy Case

  • 15-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

17/44
How to earn trophies