sparkfeather's Forum Posts

  • 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 ;)

    Ahhh no worries, well thank you for pointing out all the options

    without limitation :)

    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 :)

    OID?

    I know UID is uniqueID, however that includes all objects in the scene,

    and it would be impossible to know which instance of the object you

    wanted as well.

    I like to use a private variable 'states' to differentiate them somewhat,

    so when a creature enters the 'attacking' state it would change to the

    attack animation, and spawn a weapon/ranged attack/effects on frame 3,

    it would know to check for frame 3 of an enemy instance in the attacking

    state, however how would I get the weapon/ranged attack/effect to spawn

    at that enemy specifically. Because it wouldn't know which of the enemys

    positions to spawn at.

    I've tried with the enemy damage text, when an object is overlapping it

    I have the text spawn at the enemy once by using 'trigger once',

    however if there are multiple enemies, it will cause it to only create

    a text at one of the enemies you are overlapping.

    I've tried using the 'for each' event condition, but it causes one enemy

    to have the text created once like it should, but the other enemies that

    are overlapped continuously spawn the object while they are overlapped.

    No matter what I do I can't seem to have events run while considering

    only the individual object they are running at and it's parameters/location, etc.

    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.

    What happens when you need to know that one area of an object you need

    a timestamp for won't overlap another area. You just make multiple timestamps?

    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.

    While reading over that, thanks to it I was inspired to another possible

    solution.

    I could have a global variable that's set to 1, and have every event

    where I use multiply by that global variable, and then with the events

    where I cause the timescale to for example be set to 0.2, I could set

    that variable to 5, automatically causing the time for those events

    to balance out. Would that be a good solution?

    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.

    Thanks for that recommendation, I've looked over it a bit and it's a

    great example, I'll be sure to delve into it deeper before responding

    again, and once again thanks so much for taking your time to help me like

    this, I appreciate it so much! ^^

  • Arima

    So, from that example Arima as I now understand it thanks to your

    fantastically layed out and simplified written view of how it works,

    because at 1fps timedelta in that expression will result with 100,

    and 10fps it will result with 10, the time passes as:

    1 x 100 = 100,

    and

    10 x 10 = 100,

    in other words it will end up traveling the same amount.

    Thank you so much for that example, it really allowed it to make sense

    for me, I greatly appreciate it!

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

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

    tulamide

    I'm not using this for movement, however I understand what you mean

    by only using one method as it would easily unsynch the gameplay

    if you were to use different methods in the same game.

    Thanks a lot for that information, I hadn't recognized or thought

    about that but that certainly makes sense how you put it. An event

    can't run every 1ms if it can't register that amount of time passing,

    and would make the event occur basically whenever it could, cause

    at 60fps every frame that is registered would have passed a millisecond,

    and it wouldn't know a millisecond had occurred between those frames

    because it wouldn't have been there to find out.

    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.

    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.

    #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.

    Both of these issues are the reasons causing me to currently use ticks

    for some events, but now I recognize that's certainly no safe option,

    however you can't run events after 'x' timedelta or anything like that.

    Even with a global variable if multiple objects/events used it it wouldn't help to set a single global variable to 'Time' and keep

    setting and then checking after time has passed with that.

    The timeline object would in a way share the problems described above

    for the timestamp solution.

    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.

  • Thank you very much for all your additional replies with further help.

    It's just a shame it has to be so complicated to run games successfully

    across different computers with different framerates/refresh rates,

    and that timedelta confuses the hell out of me.

    It makes it more 'programmer-skill-memory-independent',

    and I've read the wiki link about it multiple times and I still don't

    really understand how it's used/where it's used.

    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?

    Also in this example,

    "Note that at 100 FPS, TimeDelta = 0.01 and 200 * 0.01 is 2: that's the 2 pixels per tick we needed. And at 50 FPS, TimeDelta = 0.02 and 200 * 0.02 is 4. In general, to move an object at a rate of pixels per second, simply use:

    Set X to .X + (r * TimeDelta) "

    What is the "r" in "(r * TimeDelta)"?

    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?

  • Thank you very VERY much for taking such time to create such a fantastic

    example for me, it really helped clear things up and I greatly appreciate it.

    I wouldn't have a clue make an example such as that so all I could do

    was try and estimate by counting.

    So would running an event 'every x miliseconds' be more accurate if I

    were trying to have something run consistently (say every 20 miliseconds),

    or would that be affected by the timescale, or would ticks be fine for

    something like that?

  • Hello, I'd like to ask a quick question if possible.

    I'm trying to workout if ticks is effected by timescale,

    so for a test I had it create an object every 300 ticks.

    I counted to 10 while timescale was at 1 to try and get

    the rhythm, then changed timescale to 0.2, and it seemed

    to then only take myself to count to 7 before a new

    object was created.....How does that work?

    If it is affected, shouldn't it slow down, not be faster?

    Is there any way to stop it being affected, or a method

    I can use to make events occur based on time in an easy

    manner, unchanged between timescales?

    Because I want to use timescale as part of the game, but

    I want some events to occur after the same amount of time

    without scaling because of timescale,

    I'd greatly appreciate any help I can get for this.

  • Well the actual main problem I'm having, is for some incomprehensible

    reason, when I create a weapon during the player animation, it freezes/lags

    before the conditions are met to create it (it's set to be created when

    the player reaches frame 3 of an attack animation, however the lag/freeze

    starts at frame 1 of the player animation),

    and then the entire game seems to be sped up a ridiculous amount,

    as it almost seems to skip to the end of the player/weapon animation,

    an effect I have that's created at a frame of the weapon animation,

    nearly disappears to fast to see it (so you know that it isn't skipping

    frames, its' going through them all too fast), and if I hold left or

    right during the half a second or so it seems to be too fast,

    the player launches off the side of the screen because of the speed.

    However, for some reason I've discovered that if I set off all the

    destroy actions for the weapon so that it doesn't get removed,

    the second time I attack the animation plays through at the correct speed.

    I can't understand how the existence of the weapon causes it to function

    correctly.

    I've verified that it's the weapon, because when I delete the weapon

    from the project, the characters attack animation plays perfectly when

    running the game.

    Also when I set to buttons to just create the weapon, and destroy the

    weapon (so that I know no other actions are being made/changed when

    it is created), and when I create the weapon, then do the attack command,

    it plays through the animation perfectly fine without any freeze/lag

    or speeding. But when I press the button to destroy the weapons and

    try to use the attack command again, it does that lag/freeze>speed action.

    I can't understand how on earth the simple existence of the weapon is

    affecting this and it's absolutely killing me, and wasting SO much time.

    I don't suppose you have any experience with this happening?

    EDIT:

    I've made a workaround, created a weapon above the layout on startup

    and changed a private variable, so the destroy events will check

    that variable and only destroy the new weapons that are created...

    It's stupid to have to have such a workaround, but it works...however.

    The hell?

    I re-enable the effect creation event, that creates an effect object

    at frame 3 of the weapon animation....and now the character is resulting

    in the same manner, freeze/lag then speed through to the end frame,

    before the character even switches to the attack animation??!

    EDIT2:

    I should also note that, unlike the weapon, with the effect object,

    if I don't destroy that, the freeze/lag/speed still happens.

  • When changing the animation, it causes it to pause for me,

    and it also changes to the same frame it was originally.

    So if it was at frame 5 of the idle animation, when setting

    it to attack it would change it to the attack animation at frame 5,

    and pause it.

    So I have to set my animations to frame 1 and resume it for them

    to switch the way I want them to.

    I ended up finding a fix for this (there were scripts setting the

    animation back to idle because the state variable wasn't changed

    to attacking). But It didn't fix my original problem anyway so

    (the one I was testing whether if not changing the state would

    fix it) =_=; Darnit.

    Thanks for taking your time to reply though, it's appreciated,

    sorry about having wasted your time x.x;

    Back to trying to find another way to fix this ridiculous issue D:

  • I have a ridiculous issue that I've been trying to solve for 2 days now,

    and I've gotten close to the source of the problem, but each time I've

    gotten closer it's become more confusing and impossible.

    (I seem to be extremely good at running into impossible issues in

    programs, =_=; )

    Anyhow, a question I would like to ask, and sorry but I'm unable to

    upload the project file for you to take a look at the actual project,

    but I hope you could help me with this problem.

    Here's a screenshot of the code area though

    <img src="http://i.imgur.com/UsY9H.png" border="0" />

    For some reason, when I toggle off the actions

    [Player: Set 'state' to "attacking"]

    How on earth is this happening?

    How can turning off an action below an event....stop the event working?

    When it's enabled, the event does work (animation changes and plays).

    I just don't understand it?

    Is this a known bug/bug/or, what?

    Please I hope someone can answer me, the time I'm having to spend on

    this is absolutely killing me, I'd appreciate any help at all.

  • Thanks a lot for that example, I wouldn't have suspected it at all but

    for some reason the actual sprite in that scene wouldn't work with erase,

    however copying it and pasting a clone allowed it to work....might be

    something to do how it was created in an earlier version, somehow?

    I created a new scene and made a test like your own and it worked perfectly,

    before going back to that tree file and discovering that issue.

    Anyway, thanks to your help I've got what I wanted working in my project,

    so thank you very much for your time and help :)!

  • Of course ^^;

    Sorry I thought I may have been missing something normal so didn't consider needing to share the .cap in first post.

    Here you are - ifile.it/9v1sb6e/treemask.cap

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've been trying to get this mask/erase working for ages,

    going through a lot of topics, but none seem to ever answer

    the necessary questions.

    Worked out though eventually that both images need to be on

    the same layer, and you need 'force own texture' enabled.

    This works fine, in the program area, however when you try

    to run the application, it completely ignores it.

    as seen here - (note: screenshot from someone elses downloaded test file)

    i.imgur.com/BIgZ3.png

    Is there some setting somewhere else that's missing?

    I'd really appreciate an answer for this.

  • Well I feel like a serious clutz right now =_=;

    I had thought that would work, so I turned off solid on the second object,

    however it still went through the floor.

    I kept fiddling through menu's looking for a possible solution,

    and at some point I realized when previewing the project and

    the object went through the floor after I had turned solid back on,

    that I had set it's collision setting to 'none'.

    However because I had already set it back to a solid now, I hadn't

    suspected that it would in fact collide with the ground with solid off,

    and just went back to hoping to find a solution elsewhere.

    However, I only realized all the above after you had told me it would work,

    and I tried again successfully.

    Thanks for the quick reply, greatly appreciated :).

  • Hi there,

    I was hoping someone could help me.

    I'd like for 2 objects to be solid so they don't fall through the ground,

    however I'd also like them to be able to intersect with each-other.

    (So object #1 could move through object #2, but neither fall through object #3).

    Is it possible to have the objects collisions be separated with families

    or something of the like?

    I currently have platform behavior on both objects if that makes any difference.

    Hoping for positive replies, thanks for taking your time to read this.