Ruskul's Recent Forum Activity

  • R0J0hound - quick question... If I have 2 vectors, both expressing magnitude and direction, can I add them together without having to figure out their x,y components? I can't find anything abou thtis and it seems everbody solves this by finding Ax,Ay Bx,By then adding those together and then calculating angle and magnitude based on that.

  • This might be more of a c3 thing but honestly... why cant we a.) have static variables for objects, constants for objects, as well as functions for objects.... you know, the same way you can if you were programming.

    It would be nice to be able to declare object functions instead of just general functions. Then you could have local function variables for that object that would be different for each instance if you set them to constructs "static" (also, why does construct 2 call its variables static... this doesn't really fit with what static means in other programing languages... why not "persistant" or something along those lines...?)... well anyway, people who program might see the benefit... Those that don't, well, you would want them if you had used them.

  • Did you end up coming up with a good solution? I'm dealing with the same problem atm. For me it all comes down to scale-ability and how well I can change things and how efficient it all is. I am considering 3rd party plugins such as rexrainbow's csv, csv2array, asv2dictionary.

  • R0J0hound - I had thought about that, but as it stands there is a major drawback:

    if I am going max speed at angle 0 and the player inputs up, you get this sort of lerp angle change where the angle sort of halves towards -90 while the character remains at max velocity. Does this make sense? It basically (in this case) is the same as simply keeping velocity the same and doing lerpangle(current angle, desired angle, 0.6). If I apply deceleration every tick against the current angle and velocity before applying acceleration it isn't as obvious but it is still there. Maybe I'm being to picky or expecting something unreal (my brain model isn't reality possible)

  • Okay, please bear with me as this takes some explaining.

    In a particular game I have (platformer using my own behavior), when I press a direction (left or right) I accelerate my character in that direction, but not exceeding its max speed. It is okay for the character to be above max speed, but not as a result of acceleration due to input (this allows for boosting, getting knocked back at expeditious speeds, etc) .

    the result of input is handled along this sort of idea:

    if speed.x > maxspeed.x then do nothing.

    else if speed.x + acceleration.x > maxspeed.x then speed.x = maxspeed.x

    else speed.x += acceleration.x

    Now, this all works fine in this game. X and Y are handled independently, essentially making this a 1 dimensional problem.

    In the game I am currently working on (top-down adventure), The problem is now 2d. If I handle the Axis seperatly, then I get a greater diagonal speed than either left or right so I need to handle them together.

    Solving the problem with a hard "max speed" and a constant deceleration against the current angle of travel and speed works fine and is an easy solution, but again, I would prefer to be able to implement a sort of "soft" max speed. But I really can't figure out how I go about this. I thought about having an acceleration to change angle of travel after getting input, but this sort of results in a race car like behavior and not something on foot.

    Any ideas how I can cort of check speed and then figure out how to change angle and resolve input?

  • You mean the dictionaries instance variables?

    yeah, not the data in the dictionary itself. Just instance variables.

  • korbaach - ah, thats a distinction to note. I imagine its intended then. But what would the purpose of instance variables be then on such an object? I was using them to store dictionary.asJson strings to load the same object to a previous point. I was concerned this wouldn't work depending, but since it doesn't change them it works out lol.

  • megatronx - egh, I better check that. I don't think I ever pick dictionary by uid, but... that could make things go squirly in some cases!

  • Hey,

    I think I must be missing something... when I was inspecting Json strings generated by construct using dictionary.AsJson, it seems that they don't include instance variables like they do for sprites. Am I missing something or is this true? Wouldn't that be a major bug if so or is it intentional?

  • Iconoclasts! oh wait... that'c construct classic...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Newb question here:

    If I create an object type variable it'll basically be static like in c# right?

    Like, I was needing a behavior that needed to know how many other behaviors of the same type were enabled. The ones that are enabled need to "talk" to each other from time to time. I thought having static variables would be the way to do it it but I seem to never know for sure what is happening in jscript lol.

    Does anyone know of a behavior that uses class types variables and how they function?

  • rexrainbow - oh no! I tried to access the links you provided ad they are down (angular torque).

    I'm currently trying to figure out how to access another object's behavior (I'm trying to make it so I can have a behavior access itself on another object for an inventory system)

    is it something like this:

    cr.behaviors_.Custom.prototype.acts.ActionName.call(someother.inst, i, j);

Ruskul's avatar

Ruskul

Member since 23 Nov, 2013

Twitter
Ruskul has 2 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies