piranha305's Forum Posts

  • okay i figure it out, the instance i was getting was not the type i was expecting. so this code achieves what i was trying to do

     	var behavior = this._inst.GetBehaviorInstanceFromCtor(C3.Behaviors.Piranha305_PubSub);
    	var instances = behavior.GetBehavior().GetInstances();
    	
    	for(let instance of instances){
    		var behav = instance.GetBehaviorInstanceFromCtor(C3.Behaviors.Piranha305_PubSub);
    		var sdkInstance = behav.GetSdkInstance();
    		sdkInstance.CallAction(C3.Behaviors.Piranha305_PubSub.Acts.SimulateMessage, channel, msg);
    	}
    

    this works good if the instance only has only one instance of the behavior attached.

    would it be possible to add instance.GetBehaviorInstanceFromCtor(C3.Behaviors.Piranha305_PubSub);

    but have it return an array of behavior instances instead of just the first instance?

  • Ashley

    Is there currently a way to invoke Actions/Triggers on a separate behavior? for example Lets say i have 2 instances A, and B, and they both have my same custom behavior.

    in the event sheet i call A.Execute Action

    I want that action to execute a trigger on all Object Types/Instance that have the behavior?

    var bInstances = this._inst.GetBehaviorInstances();
     for (let behavior of bInstances)
     {
     var behaviorType = behavior.GetBehaviorType();
     if (behaviorType.GetName() == "PubSub")
     {
     var sdkInstance = behavior.GetSdkInstance();
     sdkInstance.CallAction(C3.Behaviors.Piranha305_PubSub.Acts.SimulateMessage, channel, msg);
     }
     }
    

    So the intention of the code above is, when this action is called, it's going to iterate over all instance(of any object type) that has this behavior attached and invoke an action on that behavior, which fires off a trigger

    What i am noticing is this._inst.GetBehaviorInstances(); only returns the instances of the same type? is there a better "documented way" to get all instances which share the same behavior?

  • Ashley okay maybe what I am missing is that nothing is in fact downloaded into my browser's cache?

    that the website doesn't check which version I used last? I assumed it did.

    if it did, I would want it to load that one and only prompt me if there was a newer one avail.

    is this possible?

    I think the versions are cached in your browser, if you open up chrome dev tools and look at the application cache you can see all the version you ever opened there

  • this is incredibly confusing...

    editor.construct.net - loads the latest stable (regardless of the one you have installed)

    editor.construct.net/beta - loads the latest beta (regardless of the one you have installed)

    what link loads the version I already am working with? that I already have downloaded??

    you can pass the version as the url segment

    editor.construct.net/r132 and it should load that version, the thing is you will always get that popup to update to latest version. stable or beta if you go back far enough, maybe there should be a setting to suppress those notifications, if you want to keep working on the same version and you naviagte using to the exact version.

  • So what i have been doing is using the browsers plugin close action. the thing is after i close the game if i restart the game a Software update needed Android system web view message shows up?

    So opening the app for the first time works properly, i use the browser close action (on android device) then i reopen the app and get the update needed.

    is there a different way to provide a close application on android??

    I was testing this on a Galaxy Note 9.

  • With BBC codes i can get a outline around my text? is there a way to control the size of the stroke for the outline?

  • You can use the new ray cast feature, and the drawing canvas https://drive.google.com/open?id=1INQmMBraaUiCh89bSJqlurLjBZSeEGzW

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • https://drive.google.com/open?id=1ruI5QoME0XlcYOdcEg4RBj4j1PWx0DDi

    I created a GIF of a simple basic example. hopefully it helps

  • Unzip it on your computer not on Google drive. Then you should be able to edit it.then when you zip it back up a. C3P file you can import that file from your desktop.

  • updated c3IDE with code folding for all java script editors, you can right click to quickly collapse adn expand all sections.

  • I am not sure if this will work but the .c3p files is pretty much a compressed file, you can unzip that file, there is a layout folder that contains all the layout json files, if you find all the layout.json files that has the tilemap instance, you might be able to go in change the value.

    after you modified the json, you have to zip the project back up and change the extension to .c3p and try and import the project from the file. i tried this with a very simple project and it worked. if you have multiple instances of the tile map in different layouts it might be a bit more work.

  • c3IDE now supports converting c2 effects.

  • > what would be the benefit of having it be it's own block?

    I don´t see why such a map would need to be created during runtime with individual actions, rather than just beeing there.

    > i think it will just be for better visual, since its integrated into the new function system

    But it isn´t really, if you have to create it in an "on start of layout" event with individual actions.

    so having it as an action won't really effect performance, that map is going to be in memory and the lookup are are super quick, since its a dictionary type data structure. having it as a custom event block it will probably behave exactly the same, your still going to have the map in memory, and insert and lookups will perform the same. so the only difference between them is more for looks, i would imagine.

  • well lets say i define a jump function to the string of "jump" i could then have different implementation of a jump function that i can map to that jump string at any time, this would avoid having branches for power up that would increase jump height or something like that? it's very basic example, and you could just pass in the jump height as a param? but it allows you to switch the implementation of your function kind of like a "strategy design pattern", which i think will be very flexible.

  • what would be the benefit of having it be it's own block? i think it will just be for better visual, since its integrated into the new function system, alot of the optimization that were done for that would probably apply to this mapping as well?

    also you might want to associate mapping functions with a condition that is triggered?