mikehive's Forum Posts

  • That's what I want to do. But I don't want to do it manually - my game has a looooot of text that I edit and re-edit frequently. I don't want to be constantly previewing and adding newlines by hand because honestly, doesn't that sound like something a computer should do for you? :p

    The current character limit for my spritefont is 39 characters per line. All I really need to do is find the last instance of a " " space in every chunk of 39 characters and replace it with a newline. I've been trying to work out the logic and so far my best solution is a hideous dog's dinner of events that involves breaking the text into individual variables for lines and running a bunch of mid() and right() and find() and replace() expressions and then reassembling the lines into one string that is then sent to the text typer. I haven't tried this yet so I don't even know if it'll work - it just seems way too disgusting and unwieldly and I was hoping somebody who's good at coding (which I'm not) would be smarter than me and would know what a real programmer-type person would do and would save me from having to make such a monstrosity :p

  • Animation "Animation" is playing, Trigger event once = play sound

    ?

  • Sorry for bump, but I really need help with this

    Because my spritefont has a fixed character width and always shows the same max characters per line, I was thinking of running some sort of process on the source text to automatically insert 'newline's before sending it to the text type effect. All I basically need to do is find and replace the LAST " " space instance every x characters, Maybe regex or something. But I'm just not smart enough to work it out.

  • Ahhh okay. Try putting this part of your events:

    [quote:2pvp0xki]system - PlaceObj = 1 - Set position to round(mouse.x/16) * 16, round(mouse.y/16) * 16

    • Every tick

    mouse - on any click - set PlaceObj to 0

    • set position to self.x, self.y

    As sub-events under the first one, not as seperate events in their own right. This will ensure Construct knows you mean the object it just created, not all of that object.

  • Is it using the same event sheet as layout 1? That might be screwing it up.

  • Heya, I'm using Rex's text typing plugin - c2rexplugins.weebly.com/rex_text_typing.html - to apply a typewriter effect to my dialogue boxes. Very nice, I love it! Only problem is that the word wrap on my spritefont object kicks in mid-word sometimes, meaning you see the word start to spell out on the end of one line, only for the whole word to jump to the next line when it overflows. Is there anything that can be done about this?! The effect is so close to being perfect <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

  • Add an exception to the damage collision check you do when testing to see if the enemy has hit you? Something like:

    • Enemy collides with player, Player animation "block" is NOT playing = damage the player
  • Haaa this is cool! I like it. I feel like perhaps it needs a limitation on the time ability - right now there's nothing stopping you from just doing everything in slow motion all the time. Cool idea!

  • Did you know you can "include" the contents of one event sheet in another? This plus groups is hands-down the way to go. My game has a huge amount of "global" code that handles basic things like controls, dialogue box logic, how loading zones work, etc, and then I include that master sheet in every other sheet for the individual levels so I don't have to deal with that stuff at all unless there's a problem with it. Putting things into groups shouldn't mess them up per se, as long as the groups are Active in the way you'd want, but do look into whether you messed up the order of some events by moving them into groups? Make sure Construct can cycle through all the events in order and in a way that works.

  • OK how about this...

    so you're going to need to make a number sprite with animations from 0-9 and then duplicate it for how many digits you want on the counter. Call them something like digit1, digit2, etc. I'm going to assume a four digit counter like your example.

    Then on the event sheet:

    set digit1 animation to mid(zeropad(YourNumberVariable, 4), 1, 1)

    set digit2 animation to mid(zeropad(YourNumberVariable, 4), 2, 1)

    set digit3 animation to mid(zeropad(YourNumberVariable, 4), 3, 1)

    set digit4 animation to mid(zeropad(YourNumberVariable, 4), 4, 1)

    Haven't tested but that's what I'd try?

    EDIT: removed a little bit of redundancy, whoops. I was using str() forgetting that zeropad() already puts out strings.

  • Just realised I never actually introduced myself! I'm Mike, I've been using C2 for two years now. I'm making a platformer called Down To Earth about an alien who crash-lands his ship in an Earth city and has to work out how to leave. This website has been invaluable in figuring out some of my problems along the way and I hope I can help other people who are just starting out

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Or, riffing off Programmer3000's idea, what about shadow creatures who only pursue you when you're in the dark - get near a light source and they back off?

  • I can't open that file because of the MoveTo plugin, can you take it out for this example or is it necessary for this specific effect?

  • I'm wondering, does each "trap" have to have its own complicated logic? Or are they all just recombinations of prefabricated "pieces"? If it's the latter... it's not pretty, but you might be able to do something where you design a trap on a tester layout, and then write yourself a note of all the coordinates of all the "pieces", and then make an event group on the real layout that spawns those same pieces in the same places on the fly. Obviously this is a horrible idea if they're all really complicated. But if you design the traps in a clever way and maybe utilise containers you might just get away with it.

  • Ohhh are you trying to pick each individual monster eye by name? So that each eye blinks on its own random timer?

    OK try this.

    Give the MonsterEye an instance variable, we'll call it randomBlink.

    Then in events:

    Every 1 seconds: MonsterEye add random(1,5) to variable randomBlink

    MonsterEye randomBlink>=10: set animation to Animation2, set randomBlink = 0

    Just change the second line to whatever number to control the frequency of the blinks