Hillstrom's Forum Posts

  • In the end what my original question was all about was to get the best solution to solve the same problem this topic talks about:

    https://www.scirra.com/tutorials/4843/p ... m-a-family

    I always have the same problem, sooner or later i hit this wall, then i try to get around it with the first method mentioned (using functions parameters to pick a desired uid). Eventually this method becomes impossible to maintain as the project grows.

    All my solutions to keep a desired instance picked through many states and conditional changes eventually creates a hell of events just to keep track of it. I'm looking for the best solution to always keep my desired instance picked without relying on countless evaluations. The above link perfectly shows my problem and the provided solution is just a workaround as it says. I need the "profesional" solution.

    Some headaches can't be avoided i know, but i'm sure there's a better way to pick the instance i want and keep hold to it through the whole loop of interactions.

    Obviously this problem only presents when i use families and i need to affect an especific instances of an especific object of the said family.

    I take any advice to better grasp this picking thing.

  • Nice quick method I don't know why your method won't allow a second spawn object to spawn a character. I cloned your spawnpoint and it worked fine (with additional events for it), but maybe i'm burnt for today and i miss something.

    All this thing about spawners in the end is a question about how to make less concatenated "if" when i have yo check a state. I know it's a problem of not passing a needed parameter in the function that runs the event (besides the needed uid). Let's see tomorrow after a refactoring of my prototype.

  • 99Instances2Go I used rexrainbow's plugin to death but i want to understand the "normal" way to deal with heavy comparisons. Not only with creation or spawning but in any comparison in general.

    For example i'm trying to check who controls a certain character, if it's player 1 the character moves and acts with mouse inputs. If it's player2 who controls the character then he moves it with gamepad inputs. This translate to checks and checks and checks to see if a certain function runs one way or the other.

    In the end it seems there's nothing else than trying to keep function's parameters as ids and pick those given the context.

  • Yes, I end up with a bunch of parameters parsing wich get nasty pretty fast. Since this engine do a lot of picking and hidden loops maybe there was a way to get a specific instance without checking all against a desired variable result.

    The only thing i don't like about using a single object type as a "container" of different types of characters is that i'm forced to load into memory all sprites, for all animations, for all the characters i use them or not.

    Thanks Brandon12hummer for your input on the matter.

  • Hello all!

    I have recurrent doubt when i try to spawn multiple different object types from the same spawner object. Usually i end with a long If Statements similar to a Switch Case. Something like:

    FUNCTION On "SpawnCharacter"

    For Each Spawnpoint

    If SpawnPoint |"SpawnThisCharacter" = "Character01" >> Spawn <Character01> on layer "1"

    If SpawnPoint |"SpawnThisCharacter" = "Character02" >> Spawn <Character02> on layer "1"

    If SpawnPoint |"SpawnThisCharacter" = "Character03" >> Spawn <Character03> on layer "1"

    The SpawnPoint Object has a text instance variable "SpawnThisCharacter" with the name of the character to spawn. And then i have to start the long list of possible characters to spawn. If, say, i have 120 characters possible to spawn then this method starts to sound bad to me.

    How do you solve this kind of situations? Maybe it's the only way. This long if chains happens in other areas too and i'm almost sure there's something better to do. Maybe pass that ID variable as a function parameter. I'm kind of lost on this one.

    If anyone have a better way please tell me what you do.

    See you all! Thanks in advance.

  • Your "gotcha" solution is a trade off that i don't see as a bad thing. Trying to figure out how to solve my problem i get back to Game Maker (and a little of Unity) to see how those engines use arrays in similar cases. It's impressive how easy is to get into a mess of code and, worst, how easy is to fall into logic bugs that are so much difficult to see in the mess of code. Going back to Construct 2 is like a shower after a fall into a mud hole.

    Going from code to C2 kind of visual programming lift many barriers but also makes a little confusing some aspect of game programming where there's too much of "real programming" involved (like arrays). Usualy you can look into other's code but since C2 is unique you can get stuck for longer trying to "translate" a complex process from coding to visual representations of events.

    Again your solution on the "On Create" group is pretty much needed. I don't see a better way so far.

    Time to roll this array this thing into my prototype and see how it goes.

    See you Codah! Thanks for your help.

    But, there's a trade off and, to me, unless i get seriusly stuck like in this case, it's far wort it. C2 eventually is capable of doing anything code can do. I guess that, with arrays solved, there's no more barriers to overcome.

    I really want to make your example more visible to everyone so i hopefully will be able to make a tutorial out of it. As long as Kyatric let me use his example as the template.

    Thanks again Codah.

  • Amazing codah ! Exactly what i was looking for! You used Families and individual Object Types! I now have both methods at my disposal! I'm breaking my exclamation key!

    I believe this deserve an entire tutorial on arrays just to add this method to the more popular "single object type / animation frame" method. Once I understand how SOL choose each monster in the family i will try to create a tutorial around your example.

    Thanks you very much again Codah, you solved a big issue i had from the beginning of time and by itslef this example is a powefull template of a complete RPG / Any Game cycle.

    Of course thanks to you Kyatric for creating the original example wich, beyond my bitching, actually shows the best way to go for non heavily animated objects, like inventory items, shops, level editors, etc. (I'm on your "How to Code Monster Loot Drops" this days).

    Thanks you very very much to both of you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello to all.

    If you look around the many tutorials and capx examples about arrays you most likely saw a method were a single sprite object loads all monsters types sprites (just an example) and use their animation frames to reference each monster that should take data from the array.

    I want to avoid that method, at least, for complex objects like enemies. But all examples use this animation frame method and i get stuck eventually.

    There's a popular array example made by Kyatric explaining arrays and how to loop through it (it's called MyMiniRPG.capx) and use the animation frame method.

    I want to convert that example to use individual object types per monster grouped in a family (families could be avoided for now if you want) but i can't grasp the right method.

    Let's say we have a 2d array of 50 monsters, X reference the index of each monster and Y reference each attribute of each monster.

    Now we create each monster as a separate object type with instance variables to load and save data taken from the array (Or use a "Monsters" family instance variables).

    Now imagine some kind of spawner object in the level spawning random monsters using the array data to "fill" each monster instance variables giving each one their particular attributes.

    How should i proceed without looping the array using animation frames as reference? I don't supposed to know the exact x (index) position of a particular monster in the array so i have to relay on loopindex somehow.

    Did you ever used arrays to load data to an object type looping the indexes without relying in the animation frame method?

    I can't give a .capx file because there's nothing until you take data from the array. But below i leave Kyatric's example, if you can do the same he did but using individual object types per monster and a different looping method i will be saved. Or point me some directions and i will follow from there.

    Link to Kyatric's array example:

    http://www.scirra.com/forum/forum_posts.asp?TID=48528&PID=305024&title=rpg-problem#305024

    Thanks folks!

  • I'm kind of dying here...

    Question:

    There's a clean way to manage an array without using the "animation frame" or "animation state" method as a reference to the array index?

    I'm struggling because that method doesn't scale well when there's many, say, monsters stored in the array, each with it's own set of animations.

    It force me to keep a single big "object type" as a container of all monsters with all their animations in memory. I use them all or not (monsters is just an example of something stored in the array).

    I'm trying to use arrays in conjunction with a Family (monsters) or with individual object types per monster so to keep memory low and to keep animation states cleaner for each monster.

    Question again:

    Someone ever used another method than the commonly used "animation frame = array index"? Or ever used it with a big array of objects with many animations (for instance, 200 monsters with 4 animations states each)?

    It blows my mind trying to scale Construct 2 to handle many enemies stored in an array while keeping them in their own object type.

    Please help and thanks in advance!

  • Bumping for more opinions...

    One big "Sprite" Object Type as container of many enemies/characters (with its own animations for each) accessed each by animation frames references or keep'em each in it own Object Type and don't call for unnecesary problems?

    I see this one object type for all method, for example, in Kyatric's "myMiniRpg" capx example and many other popular examples and tutorials. If they choose that method, maybe there's a reason why... or maybe was chosen because those examples were just quick examples without enough enemy types/animations... I don't know..

    Please, if you evere used a big single Sprite Object Type containing all or many enemy types (spiders, skeletons, werewolves, etc) and found it worth it agains using a single object for each enemy please tell your experience. (Enemies just as an example).

    Thanks!

  • Thanks - So it's not that crazy to keep using a 1:1 enemy:object type at least for enemies and complex multi-animation heavy sprites. I'm ok using one object type for all, lets say, 1 frame static colliders. Each frame being a different object (tree, rock, pillar, etc).

    And for more complex objects i keep them each in it's own object type, maybe using the frame technique for evolved forms of the same sprite, like weak spider (green), strong spider (red). Being from frame 0 to 10 reserved to the green weak spider and from 11 to 21 reseved to the red spider (evolution through instance variables/array).

    Someone else found that using a single big object type (sprite) worth all possible dangers against using individual object types per sprite? I'm spinning in my axis for more stories!!

    Wicked combinations of families, arrays, containers, whatever are welcome.

  • Sorry for the title but i had to do it..

    By now most of you surely had to choose how to create many different enemies, characters, items, etc.

    As i saw so far there's two main ways of doing it, take enemies as instance:

    First Way: You create an individual "Object Type" (sprite) for each enemy. Then you play with instances of these many object types.

    Second Way: You create only one general/abstract "enemy" object type and then you individualize each enemy as different animations or animation frames of this general object type.

    For example, you create an Object Type "EasyEnemies". Then from animation frame 0 to 6 you add all animations of enemy "spider". From frame 7 to 10 you add all animations for enemy "skeleton" and so for.

    Then you spawn instances of this single object type at the frame that reference the enemy you want to spawn.

    This second way is widely used in many tutorials and examples in C2.

    For certain objects/sprites, like statics scenery, looks like a good way to go. Frame 0 is a rock, frame 1 is a tree, and it's easy to reference and spawn each sprite/object like this.

    But what about complex objects/sprites, like enemies, or say, 7 player's characters?

    If i add all enemies sprites in a single object type i would get a very "heavy" object loaded into memory, increasing loading time and, most likely, i could just want 6 of 20 enemies encapsulated in this single object type or "animation frame"method.

    For all those 20 enemies as a single object type there's also each individual animation. And fear arise...

    It terrifies me to go this second way for complex objects/sprites if i have to load and keep into memory so many sprites that i could or could not need in a certain moment or level. However i keep seeing people using this method for everything, from rocks and trees to all enemies and player's characters. So i'm starting to think that i'm missing something or i'm misunderstanding something.

    Sorry for the wall of text but this is a major grey area that i never solved and never get enough info to feel safe using it freely.

    Tell me your story, it will help me a lot! One Object type for many "enemies" or better keep'em separated each in it own object type and start developing the damn game?

    Thanks dudes (and dudas).

  • Mmm... I didn't C2 admin rights after installing the new release. But it worked with Photoshop with "Run as administrator" check in Photoshop.exe's properties.

    I tried with C2 with "run as administrator" checked in it exe's properties and Photoshop.exe unchecked and also works.

    However i tried the "run as administrator" from the right click menu and it didn't work. Only the exe's Properties "Run as administrator" seems to work. I have both directories (C2 and Photoshop) with "full control" permission enabled and still failed for photoshop but worked fine with MS Paint in any case.

    So in conclusion:

    If C2 or Photoshop's exe runs as admin it works. If none is checked as admin then could or couldn't work. Even if full permissions are enabled for both main directories.

    In the end C2 should have the admin rights more than Photoshop as i understand it.

    PD:

    Marry Bill Gates and MAYBE you will eventually have admin rights as you should in an admin account with full permissions enabled everywhere. Could be a UAC problem, but as stated above it works fine now.

  • I saved in png and jpg (tried a variety of configurations like 8 bit, 16 bits, etc). My path is default: C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe

    Oh oh oh.,... (while writing i was testing some more), if i check Photoshop.exe to be executed as admin it works. I don't know why so much admin rights for an already admin account with admin privileges... I swear the whole privilege system in windows if broken damn grrr....

    Anyway... solved! Remember to check the option to execute Photoshop as admin in properties. Even if you kidnapped Bill Gates and shown him your 32 ways to grant admin privilege to every f... directory and file.

    Rage aside, thanks for your support. Consider this matter solved.

    See you all!

  • Yes, i saved it in different formats (png and jpg actually) in the temp directory where Photoshop save files by default. I tried in two machines and didn't work on either. However other programs like MS Paint works fine. To me is a problem of permissions. Happened before were you suddently can't drag n' drop images directly to a program's canvas. And in that case the problem is program's damn permissions changing or not executing as admin.

    I tried all common workarounds in case those were the problems but still doesn't works. If i'm the only case with a Photoshop not working then it's not a bug.

    I will eventually make it works, don't mind Ashly.

    If you know of something please pm me

    See you Ashly and team!