sgn15's Forum Posts

  • >

    > For exemple, to change white to black, you'd have to have:

    > parameter 0 = 255

    > parameter 1 = 255

    > parameter 2 = 255

    > parameter 3 = 0

    > parameter 4 = 0

    > parameter 5 = 0

    >

    > The parameter 6 changes the tolerence, I let it to 1 personnally, basically, it indicate to change also colors close to the one you have chosen

    >

    > When the effect is applied, you don't need to set it continuously, however, it is a webGL effect, and will not be visible everywhere, also, change color is kind of an intensive effect (since it has to check the colors of the picture), so I recommand having something to back it up in case it doesn't work on some computer, or if you want the user to turn it off

    > (the system expression Effects are supported will help you supporting configurations without webGL)

    >

    I kind of got lost there. Can you answer these questions.

    1. Can you explain if I need to set all 7 parameters (through events) if I only need to recolor the red parts of my character sprite?

    I did this:

    +On start of layout

    ->Enable Replace Color

    ->Set effect Replace Color index 3 to 0 (don't know what this means, just experimenting)

    doesn't change any color

    2. About the support of WebGL, it's supposed to work in browser preview, right?

    3. I kind of did not understand what you meant by "system expression Effects"

    https://www.scirra.com/manual/126/system-expressions

    I did not saw "Effect/s" in that link?

  • I will try now using events. I tried replace color properties yesterday.

    can you tell me what do I need to put in the parameter index for replace color? and do I need to trigger the replace color continuously or just once (like start of layout) ?

  • not sure I understood you.

    I'll replace the generic condition and action names with a new example using sort of pseudocode:

    +Enemy is alive

    +Enemy is on ground

    +Enemy is not attacking

    +Enemy is near player

    + 1 out of 4 chances or 25% chance of happening

    ->Attack

    so assuming the first 4 conditions are always true, the enemy won't attack every time those 4 conditions are true. Instead, the enemy will attack if those 4 conditions are true AND randomly (randomly would have to be configurable like X out of Y chances or in percentage).

  • Ok, I have tried the replace color effect, but it seems to work in way different from how I thought it was. If anyone is familiar with Photoshop's indexed color mode, you have a palette box of 256 colors (255 minus the background color), you can select a specific color of a sprite and replace it with another color).

    "Replace Color" effect doesn't work that way.

    Is this indexed color mode I want possible in C2? I need it to make alternate palettes of my player and enemies.

    please help. thanks.

  • Example:

    + Condition A

    + Condition B

    + Condition C

    + Condition D

    + 1 out of 4 chances or 25% chance of happening

    -> Action

    Is there a way to make this event happen randomly on a 25% probability chance even if conditions A,B,C,D are always true?

    P.S.

    I am not talking about Pick random instance or pick random whatever.

  • I only saw "On Timer" condition. Is there a workaround to have a condition that continuously happens when the timer has started but not yet ended?

    Basically, if I started a 5 second timer, I want to use the condition "if timer is more then 0 and less than 5"...

    Please help. thanks

  • Here is the proof of what I am saying

    this is the same file from my last uploaded file here

    changes:

    -replaced all objects (in all conditions and actions) into families

    -the behaviors and variables used are from the family, not the objects

    now test the file, the enemy (animation object) doesn't behave independently anymore (especially the mirrored or not mirrored action)

    Is this a bug with families? because I already read the manual on families and what I am trying to do should work with families (as far as I understood).

  • I want to do everything in the latest file I posted but using families instead of specific objects (in both conditions and actions). It seems it's really not possible to do that using families?

    I need to use families because I have several other enemy types and they all have the same AI rules.

    Basically, let's say I have 3 enemy types:

    soldier

    fighter

    gangster

    those 3 above are under the family ENEMIES

    each of those 3 have their corresponding collision box

    soldierBox

    fighterBox

    gangsterBox

    Now these 3 are also under another family ENEMYBOXES

    Now I use ENEMIES and ENEMYBOXES in my events. They don;t behave independently anymore. Is this how it really works in C2? Because I just tried in another blank file, the same exact events but using specific objects, they behave independently. So basically, I found out the problem already. C2 doesn't allow me to use families in events.

    I can make a workaround for this by making 3 sets of same events, 1 for each enemy type, just triple the work. But I thought the essence of families was for this issue? That's what I was wondering about. Please answer. Thank you.

  • uhm, that file was based from the original file I was making (but the original file was too complex with many variables to show to anyone), so I made this simplified file. The logic of the AI I used in that simple file is the same from my original file.

    I found out just now that I made a mistake in this condition

    +counter>=40

    -> Set Counter to 0

    It should be like this:

    +counter>=40

    -> Set Counter to 0

    -> Set AI to 0

    The attached file is now fixed. While this file is simplified version of my original file, I learned an idea from you (using the condition "has a wall to the right/left"), so thank you.

    Based on the attached file in this post, I would like to ask questions:

    In my original file, I use families instead of objects.

    Objects:

    Enemy

    EnemyBox

    replaced by

    Families:

    Enemies

    EnemyBoxes

    but same conditions.

    Result: only 1 instance is actually moving according to the events. The other instances of EnemyBox is not moving, but the other Enemy objects are using the same animations as the only working Enemy object.

  • Do you want to keep changing the place? If not, you can use anchor behavior

  • cvp

    Windwalker

  • Hi, I have attached a sample file. I would like someone to edit the file (fix it first).

    EnemyBox acts as the enemy.

    Enemy object's only purpose is animation, nothing else.

    If AI = 0 and every X Seconds, AI should go to either 1 or 2, to which it should walk right or left, respectively.

    AI is not resetting (I think).

    Please fix it and also I am requesting how multiple instances that behave independently but using same event/s. In this case, after fixing the "AI not resetting" issue, multiple instances of the Enemybox should already result in the instances walking left and right independently.

    I already used containers.

    Thank you.

    P.S.

    If you are using the newest versions of C2, please give me a screenshot of the events instead. I have problems downloading using direct download (torrent is working but super super slow download speed).

  • Try Construct 3

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

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

    ok. thanks.

    Can you reply in my thread too?

  • Doc AI

    Can you help me? I have the same problem (already using instance variables)

    TheSynan

    Set text to

    ObjectName.InstanceVariable

    Sample:

    Object name = Enemy

    Instance variable = Life

    Set text to

    Enemy.Life

    or you want a word before it

    Set text to

    "Enemy's life = " & Enemy.Life

    I'm not sure which instance it will pick the instance variable from (if you have multiple instances of enemy object), but that should work.

  • Anyone can help?

    Even using containers did not solve the problem