RageByte's Forum Posts

  • I've switched to Cocoon with Canvas+ for a few months now and I don't miss Intel XDK. I'm just doing the finishing touches on my banner and interstitials and for now they seem to work fine using the CocoonAds plugin. I've only tried AdMob and Android so far. I hope the in-app purchases will go as smoothly with the Cocoon plugins because I'll be implementing them next.

    As far as performance is concerned, Canvas+ is really the only difference between XDK and Cocoon and it has it's tricks. You must not use regular vectorial text with Canvas+ as that will severely impact performance so you have to switch your text for sprite fonts. Also some Browser object commands may not work with it, like exit app for example, but that's no problem because they provide you with the CocoonCanvas plugin that can do that among other things. One downside of Cocoon I can think of is that you have a splash screen that's very expensive to get rid of and depending on game size there may be a black screen gap of a few seconds between splash screens (you can also ad a custom one in addition to the Cocoon screen) and your loaded first layout. Supposedly using a loader layout should fix this but it doesn't. It may just be a bug and fixed in the future.

    One other thing you should know if you're used to developing for PC and want to expand to mobile is that WebGL effects should be used carefully because some phones, for some reason choke hard on these effects. I couldn't tell which exactly but I know that with WebGL effects my game was running at 5fps on a brand new HTC octocore and under 30 fps on my 2 year old samsung with 4 cores... To be safe I removed all WebGL effects and all of a sudden it was running at 60 fps on anything. It even managed a steady 30 fps on my old Huawei dual core with 512 ram. So if you must use effects, try to test each one on as many devices as you can before you implement it.

    I think if you go with Cocoon you will probably have less headaches than with Intel. If you choose Canvas as well the number of bumps in the road will increase a bit but it should be well worth it because the performance is clearly above Webview, especially if you're making games that require reaction speed and agility. Oh yeah, and Canvas+ also means a smaller app package because it's wrapper is about 10mb smaller than Webview.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't know if anybody's gonna see this but yeah, I second that. Look what the lack of 9 patch scaling has done to my pre-loaded objects layer. Also it would be amazing if we could control the size of the 9patch's slices by script or load a new image from URL.

  • > Make sure you didn't accidentally set Player.PressedKeys to a number type variable

    >

    I did :/

    Feel so stupid

    Hehehe coding can do that to you. I was thinking it's impossible within my script because the variable was already assigned some text values and that makes Construct forbid you to change it's type but I forgot you were replicating a custom version of my script.

  • Sorry, was away for a few days. This seems strange. You could do this:

    tokencount(str(Player.PressedKeys), " | ") - 1[/code:k7jq0g9z] The "str" turns whatever is in brackets into a text string but it's weird to have to use it because Player.PressedKeys is already a text string. Make sure you didn't accidentally set Player.PressedKeys to a number type variable but I think that's impossible. The problem may be that I set the default values of Player.PressedKeys to "-1", so maybe the event sees it as a number. You can also try changing that value to "a" or "start" by selecting the Player family and editing the variable. That way it starts with text.
  • Yes, something like that. Basically either make the portraits new objects but add them to the player family and name their Class variable the same as their corresponding actual players, or simply add new animations to each player to use only in the selection menu. The most correct way to do it would be to make a new portrait object that doesn't share the Player family and give it multiple animations for each class portrait. An object that really doesn't function at all like the Players but with the same variables and family may cause some head aches further on.

    Then you can give it a text variable that stores the class just like the Player objects have. It can even be named Class as well. Then you replace the references to Player in this here segment with references to the new object like, instead of "On Click on Player", "On Click on Portrait" and then setting the second Array value to Portrait.Class instead of Player.Class.

  • Wow, better and better...

    Now I need the entire week to understand all, and apply it to my project. Or should I start again from beginning ? I have succeeded in doing interesting things, like adding operational live bars for each active character, behaviors and animations not repeated, etc.

    Anyway, thanks again for all your work, I'm pretty sure it will be usefull not only for me but for anyone.

    The more the merrier. I figured you might have to restart your project but if you've already restarted once know that you can copy paste chunks of script form one project to another if you open them both. The key is to first copy the Variables, Families and Objects the chunks of script use, otherwise it won't work. Functions, token strings and arrays may be a bit difficult at first but believe me they are worth learning as soon as possible.

  • Just a question : when you write

    Pick Player where Player.UID != Player2[/code:2pasakqv] (on mouse click), it prevents player1 to attribute his controls to a character already selected by player 2. But shouldn't it also prevent from attribute several times the same controls to differents characters ? To make it clear, make this event possible only if Player.UID hasn't been set yet.
    I tried Pick Player where Player.UID != Player2 [b]&[/b] Player1, but it doesn't work.
    

    You could simply add "if Player1 = -1" on the first Mouse Left Click event and "if Player2 = -1" on the Mouse Right Click event and that way you can't choose 2 classes for the same player. But that's a very rudimentary selection process and I didn't pay much attention to it. Here is a better way to do the whole thing, though it uses Arrays and separate layouts - one for Player selection and one for the game it's self , like in plinkie's example. This way you can also have 2 or more players with the same class. Press a button and select the class. Then press Start to go to the Game layout or Reset to start the selection again.

    https://www.dropbox.com/s/6vyx7bt45op0z ... .capx?dl=0

    I still haven't added controls for players 3 and 4 so selecting them will spawn players but they don't do anything. Just add the token strings with the key-codes in the Controls variable of the Blue and Yellow buttons using this format "Left | Right | Up | Down | Something". You can find a list of keys and their respective codes on the web but if you're looking to assign game-pad controls to it I have no idea how because I never used that feature.

  • It works peeeerfectly !

    Now I can destroy my project and start again on solid bases. I already tested with platform behavior, and now all I have to do is add a real selection menu with nice portraits

    Thx x 1000.

    You're welcome, I'm glad you can use it.

  • Nice control scheme RageByte with clever use of families.

    Thank you

  • Ok, I redid most of it. It does basically the same thing in a more flexible way and less events. It should even be more CPU efficient. This new design relies on text variables and the tokenat, tokencount and find expressions to search through, parse and manipulate the text. The point is to store and access multiple variables in a single text variable for higher flexibility. It's harder to grasp but I put a lot more detailed explanations in there. Hopefully they will help but as I said, feel free to ask.

    https://drive.google.com/open?id=0ByMnh ... 3dnNnBtNDg

    EDIT: I accidentally used the latest Construct beta r236 for this so you'll need that to open it.

  • I found a way to do this but it's still a bit bulky. I'll try to trim the script tomorrow but for now it still saves you the hassle of writing separate events for each player. Also it works pretty well. Left click to select player 1 and right click to select player 2. The first uses WSAD + space and the second uses the arrows and num zero. You could easily add as many players as you like provided you have enough keys for them.

    https://drive.google.com/open?id=0ByMnh ... 3dnNnBtNDg

    If you have questions let me know.