Yozzik's Recent Forum Activity

  • I've been talking about this on forum for a few years from time to time - hope in C3 discussions it has more chances.

    Since we can refer to audiofiles "by name" (like "Play (by name)"), can we create objects by name and refer to them?

    Like instead of well known "click to choose" we will have a field to enter object's name.

    Such a flexible logic can be really handy in many situations like:

    1. When you use array or CSV to store data about units and spawn them. For sure, i can spawn a sprite named "Unit", refer to it's animation to define unit type\graphics and then do a ton of actions to set some specific parameters (movement speed, HP, damage, etc.). But hell i could predefine them in different objects and then just spawn.

    2. When you have a lot of objects on the scene and on touch you react in specific ways (like get damage from subject). For sure, i can hardcode every case (a ton of similar events) or somehow use the family. But hell i could just do 1 abstract action like set player.HP to self.HP - subject.damage or even self.HP - touch.subject.damage.

    Overall, it would be really cool to have more abstraction in events so we can save time and do more simple-looking code.

  • Excuse me, Rex, can you refer any rules of using single\double\triple quotes in non-eval mode? I`m really confused with it.

    Your code works well, but any non-dynamic (without choosing one of the random pieces) string value works only when in """text""".

  • Awesome. Just awesome. Thanks a lot again.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, Rex! Thanks a lot for all your plugins, they really help to boost my projects.

    I've got 2 questions about this CSV plugin:

    1. Is it possible to get a bit randomised strings from a cell?

    I use it for dialogs so it would be really cool to be able to get strings like "It is a rainy day at my place" from a cell "It is a rainy|sunny|trumpy day at my place" in CSV.

    2. Is it possible to execute some C2 methods or call functions from the same CSV string mentioned above?

    Like to call function "refreshUI" from a row "reply001, "Hello, Rex!", function.Call("refreshUI")"

    Thanks a lot for your help.

  • solved

  • You're picking one module with the mouse and that module is the only one picked for all sub-events. If you want to pick a different module in a sub-event you'll need to 'Pick all' first.

    That sounds like a solution! Thanks, i'll try it.

    I Agree with ramones ,

    about you need to pick all or by closest which every your trying to do.

    My only ? , Is from what I under stand both 35 and 36 are the exact same thing. Or am I wrong?

    Well, no, they have different "relY" variable.

  • Bump maybe

  • This is some weird logic either i'm missing something.

    This piece of code should change animation of initial (clicked) object and neighbouring object if it's animation is similar to initial object's. I adress them through "relX" and "relY" vars - their relative coords in array assigned when created - because it's easy in my current project.

    Problem. As for now, it only changes initial's animation (event 35). However, it passes event 34 where neighbour's animation (stored in array "base") is checked.

    Any ideas why module doesn't meets event 36's conditions?

    I'll provide more info if needed.

  • Aaand one more thing about imagepoints. When i change any variable's name it chenges everywhere it is used, but when i change any point's name i have to find every place it's used and replace the old name manually.

    Imagepoints need more love.

  • For 1. Why not place your UI on a global layer? Unless you need to generate it in a complex/variable way according to other conditions. Then there's no need for painful spawning code - you can use the editor's strengths and just place the sprites directly....

    Nope, unfortunately a single layer won't help. There are only 2 scenes in my game, currently i'm working on the first scene which is a player's house. Every room is a "link" to a logically matching interface, but you can switch between those interfaces while being in one of them (see the tabs on the left). I have a single background sprite with the set of image points on which i'm building all the interfaces:

    1. Translucent Inactive Layers is a godsend for working on a game with complex scenery, and also enables selective filtering when selecting objects/select all.

    Interesting idea but i'm afraid having a few interfaces (see the screen above) will eat more memory than loading\destroying needed one.

    There should be a similar option in the layout editor to replace objects with other objects, preserving size/position/frame/etc.

    This improvement can be really handy! However this still means "destroy X, spawn Y" and the only difference is that you can set a single action instead of 2, eh?

  • You should pack your images in to related and/or layer elements of sprites. Then cycle through the animation and/or the index.

    I understand your part about C2 logic of memory usage but i'm not sure i got quoted text right.

    On the screenshot there are, for example, lines under some texts. They all are one sprite object but with different animations (one for each situation). Same with small character cards - this is a single sprite object with animations for each character class.

    From your suggestion (as i understand it ) i see 2 ways for optimization:

    1. Spawn the whole UI on startup while loading other game objects and hide that UI on invisible layers - making layer visible is faster than spawning a bunch of sprites.

    2. Make a sprite object and store all UI stuff in it so the whole UI will be downloaded as one single image atlas.

    Which one is better? Is there any other optimization tricks in this case?

    Current approx. download size is 320kb only, memory usage - 19.5 mb (with 5 csv tables).

    It's always better to use casted data types rather than mutable data types. numbers should always be numbers.

    Yep. I'm talking about an ability to use variables in more flexible way than just picking needed one from a list.

  • 1. No idea what are you doing, but 30+ image points for interface elements seems kind of a lot

    There is a sprite that is a background for an interface, imagepoints are used for placing UI elements on it. For example, this one:

    3. Just like 1. Don't know what are you doing or trying to achieve but it looks strange from your description

    3 subfolders for "rooms" that are used as to open special interfaces and represent upgrades. However, objects are quite different in behaviors and variables.

    Naming them without "hObj_blahblahblah_etc_etc" will be really handy, expecially while working on the notebooks.

    4. Wouldn't be better to use array or dictionary for that?

    It's not the universal way as it means i have to add an array/dictionary for every object of that kind.

Yozzik's avatar

Yozzik

Member since 6 Dec, 2012

None one is following Yozzik yet!

Connect with Yozzik

Trophy Case

  • 12-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies