Yann's Forum Posts

  • Arg of course there's an easier way

    ArrayRandomValues.capx

  • internet explorer sucks :D

  • ok... I was wondering for some day now... Don't you just want a basic drag&drop? o.o

  • What you want to emulate is a function.

    You should check the plugin part of the forum, there's a function plugin

  • That's a pretty vaste question indeed. For something like that to work fine, you have first to think about data.

    The system you want to build is based on lists of things (list of object, list of attributs per object, list of available character, list of attributs per character, etc.)

    So first you have to think how you will put that together.

    In my inventory, I don't take the character into account at all. (That wasn't asked).

    But I have a list of object system with a list of attributs per object.

    You can read my capx again knowing that :

    1/ The list of object is just formed by all the animation frame of the 'item' sprite.

    2/ The list of attributs per object is contained in a "coma separated values" (CSV) string I parse. The string follow the same format for all kind of object ("type,price,attack,defense,power").

    3/ The association between each line of the string and each object in te 'item' sprite is implicit. It's just in the same order.

    4/ I load these attribute in instances variable of each 'item' on creation. This way you can easily make them evolve. The list in the string is basically just the default values.

    You pretty much can use the same system for characters.

    Same sprite for all your character but you can build different animation for each one like : "Geo_Idle, Geo_Walk, DarkS_Idle, DarkS_Walk"

    You can then have an instance variable called 'name' that identify each instance and always call animation like that:

    Character.name&"_Idle"

    Character.name&"_Walk"

    The same way as items you can have a string with a list of default attributes like "job" or "race" and some items will be available depending on these attributes.

    In the end, you can also use my slot system to check if an item is allowed in some slot or not. You just have to add some other condition check by looking at your characters attributes like I just said.

    Anyway plan things beforehand. The thing to avoid in this kind of project is code repetition. When you find yourself copypasting same exact stuff for many different object, it means you didn't plan things well, and you probably should group these object in the same sprite or at least the same family (now that we have that).

    I know that my explanation might not be enough but as I said it's a pretty vaste subject that revolve around UI programming and data handling and I can't really do it for you. (:

  • It pretty much looks like the Famous Chrome bug

    http://code.google.com/p/chromium/issues/detail?id=108284

  • need capx

    ... Well as you made a clear description, I applied all you said in a capx and I have to say...

    It works fine so far (:

    ArraySetting.capx

  • Ashley yeaaah definitely =D I dream of this feature.. often

    And addToken, deleteToken, findTokenn .... well... more token stuff 'cause token are pretty handy for some stuff

    Also Sprite["myVar" = 2].Count to count how much sprite has a variable "myVar" set to 2 :D

  • Cool :D That should simplify things!

    But I understand the fragility of such method. I'll be keeping an eye on debug values.

  • Damn I've been so ninja'd!

    Well, Ashley, why is it such a bad idea to create instances of array?

    I was planning on doing that do stream the creation of next levels of a maze while playing the current one. So running the same algorithm on the same array but with an instance variable to differenciate them.

    Like if Array.level = nexLevel -> run the algo on it

  • Just use one sprite with all the different piece graphics in different animation frame. So when you want to create a specific piece, you create this sprite and you set the proper animation frame.

    Then you can differenciate each piece by its animation frame and apply custom rules on them (how they move, how they attack, promotion, etc.)

    Note that this way when you promote a pawn you really just change it's look.

    Also don't forget to set the animation speed to 0.

  • [quote:28kt5we4]that seems strange, especially since I can access the arrays class properties immediately after create object including the UID, which would seem to indicate that the object has been already created.

    ou can access all Action/Condition/Expression of any object type of your project any time. The fact that an instance is created at runtime or not is irrelevant, as there's no parsing of the event sheet to check if you created something before accessing it.

    Anyway, I gave it another try as it is indeed a weird behavior.

    It seems that somehow, creating another array before trying to pick the first one makes the picking fail.

    So that seems to work like that.

    arrayPicking2.capx

    I wonder if it deserves a bug report or not.

    Ashley should be the judge.

  • on Collision -> set speed to 0

  • How did you get the UID you were picking with? If you hard code some precise UID before runtime it's definitely not a good practice (:

    Because UID are affected on start of layout and on creation of object. Depending on some orders it might change.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hehe nice, I made some too but I didn't go that far as making icons :D (mines are just colored square, some checker and some blurry round shape for fog or glow effects)

    So yeah like Kyat, I'll put that in my sprite lib.