programaths's Forum Posts

  • Jabadoo, I don't know how you found that one, but you aced it! Thank you very much!

  • cacotigon, I do understand your example.

    You simply use the generic familly to hold the "current instance" and reset the SOL with pick all.

    I guess that the Ashley method could be detected and optimized by the engine while yours would be harder to recognise.

    If families are cheap, I think it is the way to go.

    Thank you both for your insights.

  • Ashley, could it be included in the manual as a tips ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi cacotigon,

    the problem is that if you include "Pick All object" then you cancel the purpose of your first filter.

    There's a solution but she is suboptimal and convoluted.

    One have to use either a local variable or an instance variable.

    In that case, maybe this condition should have an option to ignore the SOL which defaults to "false".

    That way, It wouldn't break old projects and has an added bonus, it will make it clear that it will ignore the SOL.

    (Unless you decide to do so)

  • Problem Description

    "Is overlapping ... at offset" is ignoring non picked objects.

    Description of Capx

    The file show two rows of squares.

    The first one (grey and blue) permits to see which "Sprites" have been selected in the row bellow.

    The next one (red and green) is the actual test and its separation should be at the same place than the first one.

    The square at the bottom show where each separation is expected to be.

    Why ? Because the "is overlapping ... at offset" should take all objects into account and not only the picked ones.

    Steps to Reproduce Bug

    Simply execute the file !

    Observed Result

    Non picked objects are ignored in the "is overlapping ... at offset".

    Expected Result

    "is overlapping ... at offset" should be agnostic to the picked list.

    Affected Browsers

    • Chrome: YES
    • FireFox: YES
    • Internet Explorer:YES

    Operating System and Service Pack

    WIN7 SP1

    Construct 2 Version ID

    Build 198

  • I modified the ".capx" to introduce an else (at 8) for the "pick instance ..." (at 5) and it seems that "pick instance with" is false when no instance has been picked.

    The manual says :

    [quote:1euqybjb]Else

    Run if the previous event did not run. Note that this condition does not pick any objects: if it follows an event that picks objects, in the Else event all instances revert to picked again. Else can only follow normal (non-triggered) events. It can also follow another Else event with other conditions to make an "if - else if - else" chain.

    [quote:1euqybjb]Pick by unique ID (UID)

    Pick the instance matching a given unique ID (UID) number.

    The behavior and those 2 manual entries suggest that the event at position 5 didn't run. I think that a more elaborated writing to explain : "Run if the previous event did not run" for the "ELSE" event or special "events" like "pick by" should have a notice like :

    [quote:1euqybjb]Pick by unique ID (UID)

    Pick the instance matching a given unique ID (UID) number.

    NOTE : if no instance have been picked, this event is considered as not ran.

    As you can see due to confusion, I have an unnecessary check at position 6. Here is the "before"/"after" figuring it out (the 2 versions are what I intended the original capx to do!):

    Before:

    After:

    I think that this example or a simplified variant could be introduced in the manual.

  • Problem Description

    ELSE block not triggered

    Attach a Capx

    https://drive.google.com/file/d/0B-_hh3 ... sp=sharing

    Description of Capx

    An 25by25 array is filled with "Entities" as such that :

    Array.at(floor(Entities.X/32),floor(Entities.Y/32))==Entities.UID

    Steps to Reproduce Bug

    • Run the capx (it is an "Engine" missbehaviour bug)
    Using Canvas 2D renderer
    Picked instance at ( 8,4)=1 Browser_plugin.js:580
    Number 1 Browser_plugin.js:580
    add1 8 Browser_plugin.js:580
    Picked instance at ( 9,4)=2 Browser_plugin.js:580
    Number 1 Browser_plugin.js:580
    add1 9 Browser_plugin.js:580
    add1 10 Browser_plugin.js:580
    Picked instance at ( 11,4)=3 Browser_plugin.js:580
    Number 1 Browser_plugin.js:580
    add1 11 Browser_plugin.js:580
    add1 12 
    [/code:308equ79]
    
        
    [b]Observed Result[/b]
    `"Stop loop at  "& PosIndex` is never logged in browser console/
    
        
    [b]Expected Result[/b]
    Either one of these must be logged in browser console:
    [ul]
        [li] "Stop loop at  "& PosIndex
       [/li][li] "Number " & Entities.PickedCount[/li][/ul]
        
    [b]Affected Browsers[/b]
    [ul]
        [li] Chrome: YES (Version 36.0.1985.125 m)
        [/li][li] FireFox: YES (Version 31)
        [/li][li] Internet Explorer: YES(Version '11.0.9600.17207 UV 11.0.10)[/li][/ul]
        
    [b]Operating System and Service Pack[/b]
    Win7 Ultimate, Service Pack 1
        
    [b]Construct 2 Version ID[/b]
    R175(64Bit) built at 17:04:53 Jul 2014
  • Hi,

    Look bellow :

    <img src="http://www.programaths.be/construct/fora/snap.png" border="0" />

    dragging is a global variable. That permit to not process sub event in case nothing is dragged.

    As there is not familly "yet", I had to copy-past this for each shape.

    The "magic" is done in "set position".

    floor take the nearest integer to 0. So "3.5" become "3".

    We want to map : "A.B" to cell "A". So, floor does it well.

  • I did update it.

    1)Space now flip the piece too.

    2)The 3by3 L can be rotated once grabbed.

    Thanks for comment ;)

  • Hi,

    I've made a simple pentomino game : programaths.be/games/pentominos2

    Enjoy :-)

  • It's seems that some people are confusing free and open-source !

    Actually, open-source means only that the source is available, open.

    So, if I pay 100? but that they give me access to source-code, there is nothing wrong with that.

    But it remains a compatibility with "paid" and "open-source" and this is mainly due to users !

    It's easy to buy it and make a custom build that you could give away!

    I won't, but I would definitely learn from it !

    By the way, Construct is a good product but It's definitively worth to have it as web application.

    You could have the editor available online with ability to create games on your server and offer game hosting plans.

    Base subscription (free):

    • Access to WConstruct and up to 1GB game storage.

    Intensive subscription:

    • Base subscription + more space + collaborative space

    Business/Corporate:

    • All of the above + some kind of versioning.

    The engine should be able to work offline and sync automatically when connected.

  • Ok,now I picture it

    But I find group more suitable, not for a technical point of view :p

  • It appear to be a very, very quick answer...too quick !

    What about this NPC (Non Playable Character) ?

    <img src="http://www.programaths.be/construct/state/npc.png">

    He has 7 states, so 7 groups.

    With boolean, the first few interactions have to be checked with :

    <span class="syntaxdefault">
    if�</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">not</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$shield</span><span class="syntaxkeyword">)</span><span class="syntaxdefault">�and�not</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$sword</span><span class="syntaxkeyword">))</span><span class="syntaxdefault">�
    </span><span class="syntaxkeyword">{
    </span><span class="syntaxdefault">��say</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"you�should�grab�..."</span><span class="syntaxkeyword">);
    }
    else
    {
    </span><span class="syntaxdefault">�if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$shield</span><span class="syntaxkeyword">)
    </span><span class="syntaxdefault">�</span><span class="syntaxkeyword">{
    </span><span class="syntaxdefault">��say</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"grabb�sword"</span><span class="syntaxkeyword">);
    </span><span class="syntaxdefault">�</span><span class="syntaxkeyword">}
    </span><span class="syntaxdefault">�else
    �</span><span class="syntaxkeyword">{
    </span><span class="syntaxdefault">��if</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$sword</span><span class="syntaxkeyword">)
    </span><span class="syntaxdefault">��</span><span class="syntaxkeyword">{
    </span><span class="syntaxdefault">����say</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"grabb�shield"</span><span class="syntaxkeyword">);
    </span><span class="syntaxdefault">��</span><span class="syntaxkeyword">}
    </span><span class="syntaxdefault">��else
    ��</span><span class="syntaxkeyword">{
    </span><span class="syntaxdefault">���say</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"Do�you�want�to�..."</span><span class="syntaxkeyword">);
    </span><span class="syntaxdefault">���if�</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$wantlearn</span><span class="syntaxkeyword">)
    </span><span class="syntaxdefault">���</span><span class="syntaxkeyword">{
    </span><span class="syntaxdefault">����</span><span class="syntaxkeyword">....
    </span><span class="syntaxdefault">���</span><span class="syntaxkeyword">}
    </span><span class="syntaxdefault">��</span><span class="syntaxkeyword">}
    </span><span class="syntaxdefault">�</span><span class="syntaxkeyword">}
    }
    </span><span class="syntaxdefault">�</span>[/code:dwc5r2aw]
    
    Etc...A big pain in the ass, unless you use a "state" variable that you have to keep consistent between all events.
    
    And this one is a trivial NPC because he doesn't offer quests that depends on others quests 
    Etc.
  • Event groups are worth to implement !

    Here is why !

    When they are used accurately, they give you a very simple way to handle complex scenarii and state based actions, the most well know being in game menus !

    In the page above, I show how use groups to handle motion and handle user typed commands ! (see the link)

  • What would be nice would be to have type hierarchy.

    Like in OOP.

    And on top of that, some kind of constraints based on families. (to simulate tagging interfaces or multiple inheritance)