Fengist's Forum Posts

  • No problem. The HTMLElement can be quite confusing as it uses some rather unconventional methods to achieve what it does. It took me a good while to figure it out from his examples. I've figured out how to use most of it and the power it has and the unique abilities it gives C3 is pretty amazing. If you have any questions, just ask.

  • It appears I misread the OP.

    It depends on your game but if it's a shooter type game with PVP or cooperative play you'll need both if you want it to succeed.

    A game without players needs bots. A game with just bots, needs players.

  • And a quick suggestion.

    I use codepen.io to test out what I'm going to be doing in the HTMLElement. On that site, I can play around with the HTML, the CSS and any JS (which the CSS Injector also handles) and make it look and function exactly as I want.

    Oh, and to confirm how you're doing it does work, that skill tree in the second image, that's generated on-the-fly from several MySQL tables. I use an AJAX call to a PHP file which builds the HTML and sends it back to the client in a JSON. I then save the HTML as a global variable. This allows me to do some cool stuff as I can do a 'replace' on the HTML variable to search for specific codes I included to make instant changes. Then, I set the HTMLElement.text to that variable.

    If done right, HTMLElement will even respond to clicks on the HTML and call functions in C3.

    Take the time to learn it, you'll love it for doing news.

  • Previously I used the text box to accomplish this and it was a challenge. I'm going to be adding in news to my app and I'll use the HTMLElement.

    To set up the HTMLElement, the text property under HTML holds your news. If you use HTML, check the box "Text like HTML".

    To get the scrolling you'll have to make changes to the 'inline style' properties.

    Make sure the word-break is set to what you want. Break-word will wrap the text based on spaces in your sentences.

    overflow-x will add in a horizontal scroll bar. Set it to hidden if you don't want a horizontal scroll.

    overflow-y will add in the vertical scroll bar. Set it to auto or scroll. If set to scroll, a vertical bar will always appear. If set to auto, the vertical bar will only appear when the text is larger than the box.

    You should get something that looks like this:

    The author of the HTMLElement also created a CSS injector that makes it real easy to add in your own css styles:

    construct.net/en/make-games/addons/166/inject-css

    If you play around with CSS much, you can come up with something like this which is also the HTMLElement:

  • They added an expression: unixtime

    Maybe make a feature suggestion for the rest of the date api?

    That should be built into a language like JS. Instead, what I'm discovering is that in JS you either have to include some huge library or write your own.

    I haven't checked the expression and I may. All I wanted to do was convert a unix time (in the future) to a date time string. I feel like landing on the moon would have been an easier task.

    But... I guess I expect to much from a programming language.

  • Well, I ended up just doing this.

    function timeConverter(UNIX_timestamp){
     var a = new Date(UNIX_timestamp);
     var months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
     var year = a.getFullYear();
     var month = months[a.getMonth()];
     var date = a.getDate();
     var hour = a.getHours();
     var min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes(); 
     var sec = a.getSeconds() < 10 ? '0' + a.getSeconds() : a.getSeconds()
     var time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ;
     return time;
    }

    Good reason for me not to invest a lot of time into learning JS. When the base code doesn't even have basic date/time conversions then it's still not a real language.

    Proof?

    Date.now() - gives the Unix timestamp in UTC.

    Date() - gives the date string in LOCAL time.

    Seriously? What logic came up with that?

  • And I'm having an issue with JS date's which make no sense.

    -> SkillFinished: Set text to Browser.ExecJS("Date("&UDATE&")")

    Doesn't matter what I set UDATE to, it spits out the local date time in HUGE string format.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads

    You are asking questions about an aspect of gaming that is a science unto itself. Here's a place to get started:

    https://medium.com/@narengowda/how-does-any-mmo-games-backend-work-df19b44f73a7

    To answer your question about how much hardware do you need: To sum it up, there's an old saying amongst those who hod-rod cars and such, there's no substitute for cubic inches (I guess liter's in today's world). The bigger the engine, the faster you can go. Same goes for game servers. There's no substitute for hardware and bandwidth.

    Running a game server on a shared host with 1gb ram and a platter style hard drive is NOT going to come close to a dedicated server with gobs of ram, an M.2 drive and massive bandwidth.

    Now that being said, there was an old multi-player game from the late 80's that easily handled 16 players on a server with bullets, lasers, and gobs of other events, all on 386 machines over dial-up using just one server to host the game.

    en.wikipedia.org/wiki/Netrek

    Have you changed versions of construct since you saved it? If you went back in versions and tried to load it, I have seen it give that error.

  • Legally, not much. Took a quick look and nowhere did I see where he'd put any sort of license on his works. Which means, by default, they are copyrighted.

    I also took a look on his Github and he has been pretty active on there. You might try to contact him and ask him what the license is on his works.

    github.com/rexrainbow

  • I agree. If I have the app installed and it asks to upgrade, it should upgrade the app and not just load the editor.construct.net/whateverbeta. Either way, now that beta & stable are sync'd and stable has the new functions, I've switched back to stable just to keep from getting asked to upgrade every time I run the app.

  • Thanks Ashley Is there any way to get the script to fire when only a specific layout is visible?

  • Not a JS coder but.

    function anipgbar(){
     var p = document.getElementsByClassName("animated"); // class name
     var orig = parseInt(p[0].getAttribute('orig')); // holds the original value of the pg bar
     var cval = parseInt(p[0].getAttribute('value')); // current value of the pg bar
     if (cval > orig) {
     p[0].setAttribute('value', orig); // set the pg bar back to original value
     }
     else
     {
     p[0].setAttribute('value', orig+1); // add 1 to the pg bar value
     }
     };
    
    window.onload = function(){
    setInterval(anipgbar, 2000) // run the function every 2 seconds
    }

    Is there any reason that shouldn't work? It's purpose is to animate a progress bar by increasing and the decreasing it's value. I know the css for it is loading and I know this works on codepen.io but it doesn't work when I load it into C3, and, I checked, it is loading the .js file.

  • Ashley I've been following the bug report. I just noticed. If I run C3 from the desktop icon and I don't update to the latest beta, C3 does not get the bar. However, if I create a new project with just a button and a browser and request full screen when the button is clicked, the project preview gets the new bar in both full screen and non-full screen.

    If I do update to the latest beta, then C3 gets the new bar.