Ruskul's Forum Posts

  • I think this has been resolved at this point but I was curious if you figured anything out definitively. I have been putting properties in .instance for all my behaviors (so I noticed lol) and there doesn't seem to be any difference that I noted. There must be right?

    I suck at jscript and am much more comfortable with c++ or c# so sometimes I just fly with something if I saw it that way even if I don't understand why.

  • create a new C2 project and search for "speech"

    Here you find an example of speech synthesis.

    Thanks, sometimes I feel like I miss the most obvious in my quest to find something. Thanks!

  • Hey everyone,

    I remember a year ago that I there was a way to make construct2 read some text aloud. I can't seem to find any mention of it. I also don't remember if I was using a custom plugin or not. I could have been.

    Does anyone know how to do this? I had a robotic sounding narrator readiing text.... it was neat.

  • Howdy all,

    I am looking to establish a business relationship with someone who can produce behaviors and pluggins for construct 2 who can afford to work very small jobs (this would be a sort of "on the side" gig ). The coding will be varied, but typically very short and something you could easily do in a few hours.

    I am an experienced coder and typically do the work myself, but life circumstances are preventing me from coding as much as I would like to. Consequently, I need help. To give you an idea of what you would be doing, see the 1st job description bellow.

    I need a a behavior that does the following:

    Saves the following states:

    Up

    Down

    Left

    Right

    Run

    Jump

    Fire

    Special

    For each state, the following expressions would be available (i'll use "up" as an example):

    behavior.Up (returns true if state "up" is true)

    behavior.UpA (returns true if state "up" was set to true this tick)

    behavior.UpX (returns true if state "up" was set to false this tick)

    behavior.UpLT (returns the amount of time passed since up was set true last time)

    behavior.UpT (returns the amount of time passed since up was set true this time)

    behaviror.UpD (returns true if state "up" was set to true twice in the last n time, where n represents a property that could be changed)

    Those same expressions would also be available as conditions (minus the ones that return a number, rather than boolean)

    Then as you might assume, the following actions per state would be available:

    Set stateDirection (select Up,Down,left,right , select toggle, On, Off) - This action would store the new state of an object, store the time the event happened, and store the previous state as well.

    I think thats about it.... At this point I would ask you about questions you may have about implementation, and I would ask you how long you think it would take (ie when will you get back with it) and how much money you would want for it. I would tell you that I wouldn't pay more than $25usd for it. Because most of this script involves simply retyping a bunch of crap I should expect typing speed will have more to do with dev time than anything else.

    Cheers

  • Arima

    I'm just curious how well this works in a large game where you have many little people running around. It seems like it would be a lot to ask for to have to keep reordering the objects. I've never thought about this problem until now, I originally assumed you could simply change the z order index to some arbitrary number... then you just set z = y or something similar. Also, that way the only thing changing is the objects that are dynamic and you wouldn't have to touch all the scenery...

  • Zebbi - Did you answer your question about instance based update vs object based update? If I'm understanding you correctly, then I use it to control each instance as I see fit. You can update all of the objects or you can use the conditions to narrow down which ones are affected.

    You need to make sure all get updated though and that none get updated more than once... unless you are simulating high speed and need more checks per tick for whatever reason.

    -Honestly though, at the end of the day, I have yet to be able to put the platformer behavior to a good use baring simple use case scenarios. I usually end up making my own, that way it is something new, unique, and mine. Its hard but then you can do anything and not worry about side effects of using the behavior.

    Addressing this would be great (collision filtering solids)... though I believe the most useful thing that Ashley could provide is more tools for lower level designs (access to the built in collision detection for example). Custom movement is an idea in the right direction but really lacks the tools needed to work with ideas similar to what Zebbi noted. Not being able to access collision information, I had to basically make my own collision detection, filtering, and then built a custom platformer behavior over that. At this point I still tell people c2 is great for speed and prototyping, but once you get down to "making the game" you have to script- even in c2 - if you want something original, that is, from a mechanical perspective.

  • Hey Everyone,

    Contruct 2 needs more hotkeys. Without them my APM suffers and thus my productivity, I'm sure yours douse as well. A major example is Adding variables to objects. Once the window is brought up you have to spend alot of time clicking around. Once you begin adding you shouldn't have to leave the keyboard... or at least that would be nice. Anyone else agree/disagree?

  • oosyrag I was leaning towards the way you do it for the same reasons you mentioned. I was just trying to think of the cons before I committed to that method. I generally prefer the method that a.) scales perfectly to any size project b.) is easiest in the long run (which usually means its fastest to work with).

  • Hey everyone,

    What are people's preference when creating assets (assuming you are creating mostly static bg elements). Do you create many objects and put them in families or do you create a single object and give it many frames and/or animations? Which way makes it easiest to create levels manually? What about generated levels?

    An example of this could be clouds in the sky. One could easily create 20 objects or just as easily create 1 with 20 frames or animations if they are animated.

    Why do you do it the way you do? What are the downsides and upsides to that method. I know a bit of this will come down to preference and that's okay.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • JackieChan - Excellent, thanks for posting that. I figured I would overlook something. Changing the op to reflect this. I am also adding your link to the op for the edited behavior file if that is okay.

  • Colludium and - I had a talk with Ashley about this a year ago and he said that you would most likely hurt your performance rather than help it. The collision system is very well optimized at the moment. Also, the collision detection algorithm runs much better than checks you can make in the event sheet. In general simply asking if something is overlapping is a very fast check depending on circumstances. Now I can see managing objects so there are no collision checks off screen for some games... I have done this and gained performance because of that, but I had thousands of objects that needed to be checked. Disabling them once they were off screen was a good way to cut down the volume of checks needing to be performed. But I wouldn't worry about enabling and disabling collisions a few pixels from where it matters. Actually, if the bounding boxes aren't overlapping the collision check is super fast. You would basically be doing the same thing it already does, but more slowly because it is via events instead of jscript.

  • Hey JackieChan

    I finally posted how I've done this in the past.

    It involves coding, but no fear its a few simple cut and paste / change names style coding. This solution works like a charm for platform behavior solid filtering. R0J0hound and megatronx may like this as well.

  • Solomon

    Waltuo

    Zebbi

    I think you 3 mentioned that you'd be interested in this solution when I posted it. Sorry it took me so long to get around to it. Hopefully it is still relevant. (: Also Tokinsom , you might find this interesting as well. Colludium - I think we talked about this like a year ago lol.

  • Hey all,

    Have you ever wanted to have some characters using the platform behavior to collide with some solids but have others pass right through? I have a no nonsense solution to the problem. It involves modifying behaviors, so be prepared for that. I would love to put this all in a tutorial but for some reason it seems the new tutorial link is broken at the moment...

    If you are fluent in the sdk and c2 scroll down for the TLDR.

    Lastly, JackieChan has kindly provided a link to the modified behavior if you really don't want to touch the code. If you are a veteran coder and know your way around, this is fine, but I would strongly encourage the rest to try and learn why things were changed. The more fluent you can became at working in the sdk the more powerful c2 is. Plus you gain levels as a game dev! Skillz unlocked. The link is a few post down.

    Okay, moving on...

    There is a folder called construct 2 somewhere on your computer. Probably. It should be under program files or where ever you installed it. Follow this path -> Construct2 -> Exporters -> html5 -> behaviors. Inside the beahviors folder is one called platformer. Make a copy of this folder and name it something else ("MyPlatformerModified" for example).

    You technically don't have to make a copy, but any changes you make to a behavior can break existing projects if you are not careful. Thus we will make it a new behavior.

    In this folder there is a runtime file and a edittime file. Open both.

    If you were just modifying the existing behavior you wouldn't make the following changes, but it is super important to make them if you copied the behavior. In the edittime file at the top you should see the following:

    return {

    "name": "Platform",

    "id": "Platform",

    "version": "1.0",

    "description": "Jump and run between platforms (solid objects).",

    "author": "Scirra",

    "help url": "http://www.scirra.com/manual/100/platform",

    "category": "Movements",

    "flags": 0

    };

    You need to change "Platform" to whatever you named the folder when we copied it. Make it exact and make sure you keep the same syntax (spacing, quotes, commas' etc) Syntax in coding is like grammar. If you don't use it correctly the computer won't have a clue what you are trying to tell it. Its like a grammar nazi it won't do anything unless you speak correctly. You can also edit the author to indicate you have tampered with it.

    Next, go to the runtime file and look near the top. You should see this:

    cr.behaviors.Platform = function(runtime)

    {

    this.runtime = runtime;

    };

    (function ()

    {

    var behaviorProto = cr.behaviors.Platform.prototype;

    Change Platform in both places to the same name you chose earlier. Again, make it exact. Spelling and caps matter. Anywhere you find the following code must be changed:

    cr.behaviors.Platform.prototype

    to

    cr.behaviors.TheNameYouChose.prototype

    Make sure of course that the "TheNameYouChose" is reflects the behavior ID that you replaced earlier.

    Now that you have change everything to make this behavior indeed a different behavior all that's left is to change it.

    In the Runtime file search for the following line:

    behinstProto.posttick = function ()

    and change it with:

    Acts.prototype.platformupdate = function ()

    Basically posttick is function that is called automatically by construct every tick in the game. By changing this to platformupdate we make it our own function. Now it will only be called when we tell it to be called. This is important because we now can have control over when the behavior updates. I am sure you see the significance in this

    Now because we turned this into our own function, we need a way to call it. You notice that below the function line is an opening squiggly bracket {. There is a corresponding closing squiggly bracket for every opening bracket. We need to cut this entire function out from where it is and paste it in a new location. This will be lines 383 through 943. Its quite a large function, but it makes everything in the platform behavior "work" the way it does.

    Paste it under the following line of code:

    //////////////////////////////////////

    // Actions

    function Acts() {};

    Make sure you copied the entire function! from its name to the final closing bracket. You also don't want it left where it originally came from. so make sure you cut and pasted it and not just copied it. We added it to the section of code that is responsible for containing functions that can be called from within construct as actions. All that is left now is to add this action in the edittime file.

    Sear for the following lines of code:

    AddNumberParam("Jump sustain", "The new jump sustain, in milliseconds to sustain jump velocity for.");

    AddAction(14, 0, "Set jump sustain", "", "Set {my} jump sustain to <b>{0}</b> ms", "Set the jump sustain property.", "SetJumpSustain");

    Under it add the following:

    AddAction(15, 0, "Update", "", "{my} Update Platform behavior" , "Manually call the platform update function.", "platformupdate ");

    This is where our script interfaces with construct 2 events. Save everything and open a new construct 2 project to test this out!

    One last thing! If you are new to coding for c2, if you make a mistake, when you run your construct 2 project you will get an error. The error probably won't mean much to you, but it will give you a line number. Go to the code and look up that line number and you will find the mistake. With time and practice, fixing errors will become easy and fast. Also, you need to restart construct 2 every time you make a change to your script, other wise construct 2 won't load the newer version of the behavior. Check out the SDK in the manual for more good info!

    ---------------------------------------Construct 2 portion------------------------------------

    Inside construct 2 create a quick scene with some solids. Make sure you have a least two different objects that have the solid behavior. A red one a blue one. Add a red character and give him the new platform behavior. Add a blue character and give him the new platform behavior. Add one more character but make this one purple, give it the new platform behavior as well.

    At this point, if you run the game nothing happens. The behavior is identical in how it functions to the original platform behavior, but remember we need to call its update function manually now.

    Add the following events:

    EveryTick ->

    PurpleCharacter set action Update.

    BlueSolid Disable Solids.

    RedCharacter Update

    BlueSolids EnableSolids.

    RedSolids DisableSolids.

    BlueCharacter Update.

    RedSolids EnableSolids.

    There are much better ways of managing the turning on and off off the solids as well as updating the characters, but this should give you a general idea of whats happening. I keep my characters in families with a collision id variable. I also keeps my Solids in a family that has a collision id. I then enable or disable solids based on the ID and update all characters with the appropriate Id. Basically you can handle them all in groups and when you add a new character into the game you just have to give it the correct Id. You can change the character ID at anytime to allow it to pass some objects but not others. I use 0-7 for my Id numbers and use the id sort of like 3 bits. It is really neat what you can do with collision filtering and its disappointing that construct 2 doesn't handle this itself. I consider it necessary. You can use it to create Character that you can go through some walls while others can't. You can use it to make it so some objects only interact in the background layer and some the foreground layer. Ever played mutant mudds or xenodrifter? You can make the same effect in construct now. Yay. I'll move this to a tutorial once that works.

    Let me know if you have any questions!

    TLDT _____________________________________________________________________

    1.) copy the platform behavior folder and change it to be a new behavior.

    2.) Move the contents of the posttick function into a new function as an action. Create a corresponding action in the edittime file. I named it "platformUpdate" in mine.

    3.) In c2 you can control when a platform object gets updated by calling the action you just created. Use enable/disable solids on objects with the solid behavior to control which ones the platform object interacts with.

    4.) Use families and collision ids to update platform objects and enable/disable solids in groups and batches for the best performance, project scalablity, and pretty code.

    5.) Yay. Or perhaps not. If the ladder then give holler. Usually I holler back. If the former feel free to add me to the credits of your autobiography when you are famous. I'm sure I'm the reason why.

  • Hey everyone,

    I was curious how often c2 users purchase assets. A few years ago, it seems the c2 community was happy to share effects, behaviors, etc for free. I'm trying to gauge the worthwhile-ness of putting something on the asset store instead of simply sharing it. If nobody buys it, it sort of makes the knowledge useless right?