nettemple's Forum Posts

  • A performance and basic structural question: Is it better to use multiple layouts or many layers in one layout?

    Example:

    One layer with 5 layers. Turning layers on and off (visible/invisible) according to a variable value (0-5)

    OR

    Five different layouts directing to that layout depending to a variable value (0-5)

    FYI: The basic content (text and graphics) would be basically the same.

    Suggestions.

  • Excellent!

  • I have 4 functions:

    func1

    func2

    func3

    func4

    How do I call one randomly on start of game:

    Example logic (not syntax, just logic):

    OnStartOfLayout --- > Call "func"+(random)1,4));

    I was told I could use javascript, but thats not really the answer I need as I assume you could do most anything in javascript as an alternative :-) Unless you're telling me "that is the ONLY way you can do it." If so could some suggest code - I believe this is fairly easy for a seasoned JS programmer (as I am not).

    Thank you in advance!!!

    Tagged:

  • And this was with Construct - version 3?

  • Can you provide a callFunction syntax example based on my simple scenario:

    functionName 1

    functionName 2

    functionName 3

    functionName 4

    functionName 5

    onClickAction ---> call "functionName"&int(random(1,5));

  • Instead of being forced to choose a function from the dialog window (That lists all current functions), is there anyway to call by name. The reason is that I want to call one randomly from a list like so:

    functionName 1

    functionName 2

    functionName 3

    functionName 4

    functionName 5

    I want something with this logic:

    onClickAction ---> call "functionName"&int(random(1,5))

    I hope that makes sense? Suggestions...

    Tagged:

  • You do not have permission to view this post

  • You do not have permission to view this post

  • My initial thoughts would be to incorporate the save_score.php form into the Construct project and then pass the data from that form to a php that adds the data to the MySQL database via Ajax and either returns a success or failure.

    I agree (see above example)

  • OK This is a working version:

    1) Created simple form with text input objects

    2) Created events that pass variable in a php URL using the Ajax object

    I included screenshots of the:

    - Form

    - Event sheet

    - Php code

    - MySQL table structure

    I tested and all works.

    I kept it simple. You will have to populate the variables based on your form and their final score.

    Form:

    Events:

    PHP:

    MySQL Table:

    Cheers!

  • Also getting this in both Chrome and safari:

    WHOOPS!

    The server returned a 500 exception. This has been recorded and will be looked at by an engineer shortly. Sorry!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Not sure if this is a bug or browser "Critical Error" message but its only been happening to me the last two days? Many times it will work after I reload. Anyone else getting this? Mac OS and Chrome browser FYI

    Critical error

    This should not of happened. Please contact support.

    System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) at C3.Code.Controls.Application.Caching.Redis.PubSub.PubSubController.OnSubscribed(RedisChannel channelName) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Redis\PubSub\PubSubController.cs:line 58 at C3.Code.Controls.Application.Caching.Redis.PubSub.PubSubController.SubscribeToCacheKey(RedisChannel cacheKey, Action`2 onMessageReceived) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Redis\PubSub\PubSubController.cs:line 46 at C3.Code.Controls.Application.Caching.Manager.Manager.Callbacks.OnGotten[T](String cacheKey, CacheType fromType, T objectGot) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Manager\Callbacks.cs:line 99 at C3.Code.Controls.Application.Caching.Manager.Manager.Get[T](String key, Func`1 getFromExternFunction, Boolean skipLocalCaches) in C:\Construct.net\Source\C3Alpha2\Code\Controls\Application\Caching\Manager\Manager.cs:line 136 at C3.Code.Helpers.SEO.Functions.GetUsersCurrentRegion(UserSession currentSession) in C:\Construct.net\Source\C3Alpha2\Code\Helpers\SEO\Regions.cs:line 125 at C3.Pages.Master_Pages.Global.Page_Init(Object sender, EventArgs e) in C:\Construct.net\Source\C3Alpha2\Pages\Master Pages\Global.Master.cs:line 114 at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

    Tagged:

  • I will try to do a sample based on your form page (including php files) and zip up for you - but it will be later tomorrow if thats okay?

  • Thank you (Connected, look for email)

  • If I understand you correctly - newt is correct - use an AJAX call. Here is an example that I used to do basically the same thing.

    Your receiving php page must GET or POST the values being sent and then INSERT in the proper fields that you have set up in your MySQL db. If this is not clear enough, I will follow up with code from my php receiving file so that it is a bit more clear.