Kan's Forum Posts

  • Yeah, that's what I thought, but I hoped somebody would come with a simpler method. Oh well, it was worth the try.

    Thanks for replying.

    EDIT : Javascript, maybe. I'll check into that (or do you have a link to point me in the right direction? )

  • Ok, I can find the number of times a string occurs inside a text using the "RegexMatchCount" expression. But I can't find how to get every occurence's index inside the text.

    Anyone knows how to do this?

  • Works fine on my side. I copy and paste layouts and event sheets xml files and objects animation files from one project to the other, then open .caproj files in notepad and copy and paste xml code refering to plugins, behaviours, objects, families, layouts and event sheets from one .caproj file to another. Maybe that's what zenox98 calls "serious XML hacking", but hey, it works!

    But I guess using SVN or Git, as proposed by Ashley in that tutorial, could be even easier. In my case I'd need something that allows merging two different projects, and not two version of a same project. (I think some project merging utility could be made using Construct 2 itself. I might try creating that.)

  • Alright, I'll keep that in mind. Thanks rexrainbow for this great plugin and behaviour and for the help.

    And if ever you have time to implement assigning nickname to families, that'd be even greater.

  • rexrainbow

    Thank you for taking it the time to show me. This plugin might save me a lot of events in future games. (by the way it also works with "on tap")

    One last thing, I take it as there is no way to assign a nickname to an object at runtime, then create the object? The nickname must be manually assigned by the game's creator and can't be assigned from a variable or from code while the game is playing, or the "create instance" action will not work?

  • Really? It keeps not working on my side. When using "tap", a random object is created, not the one that I want. And using "on any touch start", nothing happens at all. Did you check my capx?

  • Yeah, sometimes I use objects too, but when you use a lot of variables into a single expression, the expression starts getting really long. Example : Variable1 + (Variable2*Variable3) / Variable4 feels better for the eyes and the mind than variable_object.Variable1 + (variable_object.Variable2*variable_object.Variable3) / variable_object.Variable4

  • Ok now I see where I got lost. I confused "static" and "constant". I don't need constant variables right now, but I could use some static variables.

    Now it works! Thanks nimos100 !

  • I had read that page. More than once on top of that. Last time was today, and I had purposely avoided reading the paragraph about "static and constant variables" because it was of no interest in my case and I wanted to keep working on resolving my problem. Thanks for pointing it out though.

    Another thing you can read, in the "edit profile" page, is :

    "Don't forget, let's all be nice to each other in the forum!"

    Not quite sure if "cynical" and "mocking" is compatible with "nice", but let's say that none of us can remember every single thing that's written on this website.

    Thanks everyone.

  • nimos100 : I just tried putting everything into the same group, but it keeps not working (see capx). Why does the variable get reset to 0 anyway?

    ( R0J0hound : Yes I know, and then it would show in the debugger. But I need the variable to change over time.)

  • Pardon me my great ignorance if I simply didn't fully understand the way local variables work but, is this normal? (see capx)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • rexrainbow

    Thanks for your efforts (and for your many plugins, some of which I had already downloaded and will definitely use in the future ). I just tried it but I still can't figure to make it work the way I need it to. Here's an example of what I'm trying to achieve :

  • No problem. I just modified this example to make it even better (now the rotation is more fluid) :

  • I didn't remember this nickname plugin by Rex. But sill, you need an event for every object to give it a nickame, so it doesn't make a big difference from having an event for every object to be created. :-/

    (Plus you can't give a different nickname to every object in a family differently using the "Assign nickname" action onto that family, even in a "for each" loop : it'll assign a nickname to the whole family instead)

    No offense intended towards rexrainbow.

  • Yes, that's what Ashley said. Still, if this could be changed at least optionaly, it'd be terribly great.