Kaisirak's Forum Posts

  • That makes sense, thank you Ashley

  • I'm writing a shader, and I was wondering if there is anyway to only check a specific layer when sampling the background.

    For example when I use:

    lowp vec4 back = texture2D(samplerBack, mix(destStart, destEnd, vTex));

    if (back.a > 0.5)

    is there anyway to exclude or specify a layer, or is it always the sum of every layer other than the current layer ? So in this instance back.a would only refer to the alpha of the layer under the current layer.

  • Is there a way to get the value for the WebGL effects parameters?

    For example I created a shader with an Intensity value that's on my layer 0, is there a way to do Layer[0].Effect(myeffect).Param(0) and get the current value ?

    I could store them manually on the side, but if I don't have to, I'd rather have a cleaner project.

    Thanks

    I voted for modularity. Being able to have a HUD that remains through the game without having to manually code them into place would be a huge time saver for example.

    And as for multiplayer, there is already a functioning plugin by zack0wack0 if I remember correctly.

    It might not be the most optimized thing in the world, but I did create a multiplayer game with it and node.js , it was playing fine with 4 people (well, 3 and a local player). Granted there was a lot of client side prediction and it would have probably exploded with 16+ people, but it was playable.

    Anyway, like someone above me said, you use multiplayer in some game but you would use modularity in all of them.

  • No problem, as for the choose, what I meant was instead of having choose(1,2,3,4) try using choose(1,1,2,2,3,3,4,4). That way even if there is only one option there will actually be two.

  • Thank you, I'll give this a look

  • The thing is, I don't want to create an event for 50 types of enemies, meaning I wish something like this were possible:

    system:create(typeOfEnemy)

    instead of having to do:

    if(typeOfEnemy == 1)

    {

    system:create(type1Enemy)

    }

    else if(typeOfEnemy == 2)

    {

    system:create(type2Enemy)

    }

    else if(etc)

  • Hey sorry to bump this but I could really use an answer.

    to Simplify my question, can you choose which object to create at runtime, at least in a family ?

  • Yes you "draw" every sprite you're gonna use in a specific layout, this is by design.

    In my opinion this is a design flaw, if the object is in your project you should be able to create it whether or not one already exists. But since I don't know the inner workings of C2 I have no idea of how feasible it is, and I trust Ashley.

    Best thing you can do is either create a layer or a family with all the object you had to create, and then use on start of layout -> destroy for every object in the family or layer.

    Ninjaed by Kyatric, you sneaky devil

  • It depends: -doing it on the same computer is pretty easy.

    -Doing it online with mostly client side programming requires a little programming and basic network knowledge but is not too hard.

    -Doing it with mostly server side coding and using C2 mostly for display is the hardest and more network intensive but also the most secure(really hard to cheat).

    Most of the time you won't need the third option, unless you're creating an MMO or any game where online is the most important aspect.

    If your friend knows what he is doing, he can really implement both without it being too hard.

  • If you're using tokenat, it shouldn't be an issue though.

  • Well no actually, that's the point of the array, you won't make a mess precisely because you only need one X for each type of building instead of having an instance variable for each object you create and then having to decrease each of the existing objects' variable.

    What you don't seem to understand is that you can't change the default value assigned to a type of object, however what you can do is change the value you check when creating a new instance, which is what I do with the array. But nothing prevents you from using a variables in a player object, that would work just like the array.

    TL;DR : you can't change the default value, because it's a default value, arrays rule, I'm awesome

    Kaisirak out...

  • Well you can use a text variable or even a text, and either:

    obj.options & "1," on option 1 selected

    obj.options & "2," on option 2 selected etc

    or append text

    And to deselect one, use replace to find the value of the option and replace it with an empty string.

    As for choose, instead of using one value for each option, use twice the same.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see the problem.

    When you create a new instance, construct2 "picks" it, and since you assigned 10 as the default A value, it reduces your credit by 10. What "I" does is set A to 5 for all the instances that already exist.

    A simple solution to this problem would be using an array to store each type of building's cost.

    Here is the capx: modified_buildings

  • Is there a way to select which member of a famility to create when using System:create?

    Let's say I want to create a new enemy at runtime, but I want the enemy created to be randomly chosen in the family.

    Do I have to create an event for each type of enemy in the family or is there a more practical option ?