Mithrill's Forum Posts

  • I don't know will this be fixed because C2 is almost retired and this is more or less annoying "feature" rather than a bug.

    When grid size is changed from top bar "view" option, it has to be visible (double click to keep it visible), otherwise grid size won't work after clicking to layout or toggling grid size -option to off/on.

    Steps to reproduce.

    1) click click view -option on top.

    2) change grid size (height, width).

    3) click "show grid" -option OR click on layout.

    4) only 1 grid size value changed is applied.

    How to change grid size properly:

    1) double-click view -option on top, so it will stay visible.

    2) change grid size (height, width).

    3) toggle "show grid" -option off/on OR click on layout.

    4) both grid size values are properly applied.

    Tested in Construct r279 & r259 (both 64-bits) running Windows 10.

    capx: h*t*t*p*s://www.dropbox.com/s/3je7lvy1g3of7hp/grid%20size.capx?dl=0

    (remove * -symbols from https to make link to work properly)

  • First, report bug templete didn’t load after I pressed post new topic :/ So I’m trying to remember what information to include.

    There are 2 problems:

    Problem 1: When wallDetector collides with wall or groundChecker isn’t overlapping ground > other wallDetectors position is inaccurate. They stop following their target (enemy).

    Problem 2: When player sprite collides with other sprite, this other sprite’s groundChecker’s position is swapped with third sprite. This third sprite is even not part of the collision!!

    included capx contains very simplified version of mechanics from my actual game. Principle is same though.

    Way I implemented enemies walking/patrolling behaviors is following: there are 2 sprites which serve as helper sprites. They detects when enemy is near wall or not on ground. They are also containers of enemy sprite and are named wallDetector and groundChecker. I’m using boolean to set their position. When boolean is true = follow, false = do not follow.

    When wallDetector collides with wall > change enemy’s walk direction.

    When groundChecker isn’t overlapping ground > change enemy’s walk direction.

    Recreate problem 1 bug:

    1. Wait till one of the enemy collides with wall or it’s groundChecker isn’t overlapping ground

    2. Other enemies wallDetector position is reset (they stay in place).

    Expected results: every enemy’s wallDetector to follow each enemy.

    Recreate problem 2 bug:

    1. Press right key on keyboard and move player sprite to right

    2. Collide with enemy sprite

    3. On collision, player’s position is moved by qarp and reset after reaching destination.

    4. On collided enemy’s groundChecker will change position to another enemy’s location

    Expected results: groundChecker position to stay on correct enemy.

    Example capx: h*t*t*p*s://drive.google.com/file/d/1ophpnoj42Kg7BUMnnK0ZZCUWnsFdGjtl/view?usp=sharing

    (remove those * -signs to download)

    I have no idea how problem 2 is possible because I thought that on collision event takes on consideration only those objects which are colliding. Or I’m doing something wrong in on collision events, which is most likely the case here.

    Tested on: Construct 2 r255 and r259.

    Chrome

    Firefox

    Explorer

    NW.JS

    Used operating systems: Windows 7 and 10.

  • dop2000 Thank you very much. That was just what I was after

  • Hey everybody,

    I have a question about controlling player character(s). Currently I’m creating couch co-op game. Game supports 1 - 4 players. I’m trying to figure out how to make controls to function with all the player characters.

    Currently my game setup is this: each players character is created from the same object (sprite). Object is called hitbox. This sprite has an instance variable called ID. On creation, first player will get ID nb 0, second player 1 and so on. ID is zero-based because gamepad id’s are also zero-based. Key bindings are stored in an array. Then, when gamepad id (in this case, 0) is used, hitbox with the same ID is picked and action is fired (move left, move right, jump etc). I hope screenshot below will help to understand the basic concept.

    https://www.dropbox.com/s/0n750btrpkbl7 ... 1.png?dl=0

    This method isn’t very effective because it requires that I copy-paste exactly same events for every characters. 4 times in my case. Not very convenient. So I want to make a system where controls events are set once (like in screenshot but without that PLAYER1 value) and then based on the gamepad id, matching hitbox is picked and movement/action is fired.

    For example, I press A button on any controller, then C2 could tell me that button A is pressed from xyz gamepad. Let’s take a look at event 117 (in screenshot) for example. “Gamepad PLAYER1 right analog stick…”, where PLAYER1 is replaced with correct gamepad id.

    So, is there a way in C2 to determine which gamepad is used?

    -M-

  • Thank you everybody.

    RayKi Yes, really good options for different camera behaviours.

    99Instances2Go this was a new thing to me! I have always thought that layout should contain only one camera object and if there is more than one, they will interrupt each others. I was so wrong.

    R0J0hound I can see the pattern ^^

    I made some testings. There isn’t that much of a difference between methods, so I think it’s more like what I want to use

    If anyone is interested to see my results, here is the link: h*t*t*p*s://www.dropbox.com/s/i6oqciyjoufart5/hitbox_scroll-to_%20distance_layout_scale.capx?dl=0

    I can’t take full credits. I used 2 examples by Yann and combined them together to gain desired result.

    example 1) autoFraming: h*t*t*p*s://www.scirra.com/forum/between-sprites-distance-zoom_t69772?&hilit=autoframing

    example 2) check distance between 2 instances:

    Key binding credits goes to KYATRIC. I modified his code slightly.

    example 3) Adding custom keyboard controls to your game in Construct 2: h*t*t*p*s://www.youtube.com/watch?v=j4r1l9X4R5U&t=1393s

    -M-

  • My brain exploded O_o

    Calculations are way more complicated than I though and are beyond my skill level. If I limit number of players to 3 and calculate the centroid between those 3, THAT could be manageable to me. OR I just figure out something else. A bit more simpler, maybe? :)

    Maybe if I pick 2 characters which are most apart from each other and place camera at middle point between those 2. Or something.

    Thank you RayKi for your help :)

    -M-

  • Try Construct 3

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

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

    I’m planning to create couch co-op multiplayer game. Game won’t be split-screen. instead, all characters will be on screen at same time, like in New Super Mario Bros. Most important aspect (for now) is the camera. I want that camera follows all the characters on screen. So camera would always stay in the middle of characters, regardless of how many characters are on screen. With 2 characters it’s easy. Camera will be in between of 2 characters. With 3 characters, it will become more complicated. I made a visualisation of what I mean by that.

    pic1

    h*t*t*p*s://www.dropbox.com/s/pokxit8uixytdpo/camera_visualization1.tiff?dl=0

    pic2

    h*t*t*p*s://www.dropbox.com/s/oav8tsc0jo4s5eq/camera_visualization2.tiff?dl=0

    (remove those *** from h*t*t*p*s and you are good to go)

    So I want that camera will be at the intersection of those orange lines all the time and that’s the problem I’m facing right now. I think I need to use cos/sin or acos/asin (or some other math calculation) to calculate the correct position but math isn’t my piece of cake.

    I don’t want that somebody will do all the work for me. I don’t learn anything if answers are handed to me. I’m asking that if someone can point me to the right direction so I can continue from there. I will appreciate all kind of help.

    -M-

  • Instead of decrypting/encrypting, how about just inserting watermark over each and every sprite sheet during export? Then, when game is launched, C2/3 hides that watermark. This way, every asset is at least copyrighted to the author of that game. Also hacker(s)/cracker(s) has to at least do some clean up to be able to use those assets.

    Of course this method can't be used for music and sound :/ Maybe an extra channel of noise is inserted in music file(s) on export? So if someone unzips music from game, those music pieces would be complete garbage. Then, after game launch, that noise channel is muted and music plays normally. Just an idea, dunno would it work at all.

    This is my idea for this encryption/decryption topic. I don't know are my suggestions easy to implement in C2/3 but they are something to think of. Personally, I'm more interested of copyright issue than covering my assets because I do know that every game assets/GFX/music/sound etc can be ripped of from game. For example, every (or at least close to every) GFX/music piece from NES games are ripped of. People will find a way to hack your game, like it or not.

    -M-

  • I see. Thank you for your suggestions. I will report if this error message start to pop-up more often. Then I will also include capx-file.

    Now that you mentioned it, I should avoid using special characters on project names from now on.

    -M-

  • Problem Description

    Received an error message on saving the project. If this isn't proper forum to report this, I apologise.

    Attach a Capx

    For now, I won't because I think capx isn't causing this error message.

    Description of Capx

    I used C2 like normally and suddenly on saving, an error message pop-up. After clicking ok, I tried to save again and saving worked fine. This is a second time this error message pop-up.

    Message: https://www.dropbox.com/s/24o8zcq4d770z ... 8.jpg?dl=0

    Debug log: https://www.dropbox.com/s/5gw8wok6jeosg ... g.log?dl=0

    Steps to Reproduce Bug

    • Save your project? I have no idea :/

    Observed Result

    Well, message pop-up, telling me to report it to Scirra.

    Expected Result

    Do like message told me to do. Report this message to Scirra.

    Operating System and Service Pack

    Windows 7 Professional SP1 64-bit running through vmware Fusion 5.0.5 (1945692) on Mac OS X 10.9.5

    Construct 2 Version ID

    r239 64-bit

    -M-

  • Solved!

    -M-

  • Hey everybody,

    I’m having a small problem with sine behaviour and setting size of sprite object. I have 2 enemies, small and big. Both are different in size and GFX.

    What I want to do: when player character is standing on top of the enemy, enemy will squash a bit. Then, when player isn’t standing on top of the enemy anymore, enemy will will go back to it’s original size.

    I’m using 2 sine behaviours, one for heigh, one for width. Sine which controls Width is in control. That means I’m using it’s CyclePosition to apply same value to the height sine’s CyclePosition. So when width sine's CyclePosition is 0.1, height sine's CyclePosition is also 0.1.

    Setting enemy's size back to original is done by storing enemy’s original size to 2 instance variables (originalWidth and originalHeight) on creation. I hard-coded that when sine.CyclePosition is greater than 0.5 -> set size to self.originalHeight and self.originalWidth. I hope this is more easier to understand in-game and by reading events than me explaining it here :)

    Problem is: with the big enemy everything is a mess. Size isn’t correct when landing on top of the enemy. Same thing when setting big enemy’s size back to original. With small enemy everything is working fine and as expected.

    I think, I THINK big enemy’s size is somehow treated the same as small enemy’s size. How? Because at the moment when player lands on top of the big enemy, it’s size is immediately set and sine (width) behavior isn’t activated. I checked it through debugging layout. Also bigger enemy’s height while squashed should be different than small enemy’s height. Now they are same. I set height to be 1/3 of enemy’s height while it's squashed.

    If someone has some free time and want to help me to figure out the problem, I would really appreciate that :)

    Link to example: h*t*t*p*s://www.dropbox.com/s/bqhj9zafb8rcp53/squash%20test%231.capx?dl=0

    Remove those * signs from https and you are good to go :)

    -M-

  • Asmodean

    Thank you so much! You helped me a lot ^^

    -M-

  • Hey there,

    I have a problem. This time, I’m trying to make a chain on start of layout.

    I’m using pin behaviour -template (which is included in C2) as a base. In this example, Blobs are already on layout and are pinned to each other on start of layout. Then, depending of their instance variable “number”, they are pinned to player or to each other. (I won’t cover that much details here, check my capx or example in C2 for more details)

    However, I need to create these blobs during run time on start of layout. This is where I’m having a problem. First I thought I can just replace “for each” with “repeat nn times” event and call it a day. I was wrong. I don’t understand what I’m doing wrong here.

    Remove those *** from https: to download.

    h*t*t*p*s://dl.dropboxusercontent.com/u/43020976/Scirra%20forums/pin%20to%20family/pin_to_family_example_r233.capx

    Any kind of help is highly appreciated.

    -M-

  • Thank you everyone for charing your tips :)

    Daggio,@Bro7hers, looks like my research about events sheets failed me :/ I had completely forgot about those trigger events and how they are executed.

    Kyatric, this function method sounds like a good option. Currently I really need to find a way to optimise my events.

    Cassianno, yes, I did mean event groups so my bad -_- About your tip, personally I don't want to separate my events into many event sheets. Too much hassle and to me it's hard to keep track of what is where. This is completely personal opinion of course :) I like to use groups instead.

    Another question rise from back of my head: I'm using same group structure as in my first post. Lets pretend that I have a boolean variable called "isActive" in group Enemy/AI.

    Just for demonstration,

    distance: player, enemy less than 50 > set enemy.isActive = true

    when that boolean variable "isActive" is true > set enemy angle to player.X/Y.

    else

    distance: player, enemy greater than 50 > set enemy.isActive = false

    Boolean variable "isActive" is false > set enemy angle to self.X/Y.

    What are the benefits if I disable that Enemy/AI group when boolean "isActive" = false? Because I don't see any reason for C2 to check those events in that group if Boolean isn't true in the first place.

    I was thinking something like this:

    distance: player, enemy less than 50 > set group Enemy/AI > enabled and set enemy.isActive = true

    Boolean variable "isActive" is true > set enemy angle to player.X/Y.

    else

    distance: player, enemy greater than 50 > set enemy.isActive = false

    Boolean variable "isActive" is false > set enemy angle to self.X/Y, and set group Enemy/AI > disabled.

    really quick and dirty example and I hope everyone will understand :)

    What I understand about C2, is that it will check events in every event groups which are active (obviously). If I have that 3000+ events, I think it's not really beneficial to check events from every group if those events aren't used. Using that example above: if group Enemy/AI is active, C2 will check that group and that boolean. Then C2 will run the events depending of the boolean state. BUT if that group is disabled, then C2 will skip it and theoretically save some recourses.

    If I'm completely wrong, please correct me. I really want to understand how to optimise events and how C2 is handling things.

    -M-