Kyatric's Forum Posts

  • Hi guys,

    So I'm still learning construct 2 (been about 2 weeks) and I'm trying to get my head around loops. I'm trying to build a branching outcomes system from scratch (it's probably way above my knowledge level, but I'm forging ahead), and am trying to do something where I have an array. It has a opening dialogue prompt, then 2 choices. But sometimes the choices will have requirements (like 'give me 10 gold'). I want to be able to run a check to see if the player meets that requirement, and, if not, grey it out.

    Eg:

    (0,0,0) Hi, want to stay at the inn?

    (1,0,0) Yes (10 Gold)

    (1,1,0) No (exit)

    At (1,0,1) I'd have GOLD, to signify we're looking for Gold (not...Copper or some other resource)

    At (1,0,2) I'd have 10 to signify that it's ten of that resource (in this case 10 gold)

    So I'm trying to build a for loop that says when you come across a dialogue option, search the Z axis and compare it against global varables to see if PlayerGold>Gold they're charging. If it is, I'll be able to run an event where it's unselectable, if not, and it's clicked, it'll reduce the player gold by 10. That bit I'm not too worried about.

    Ultimately I think I can do almost everything, but for some reason I can't get it to search just one axis - I can't figure out how to use loops to limit the search.

    I want to do something like:

    If ChatArray.X = 1 and ChatArray.Y = 0 Search ChatArray.Depth for CurrentValue="Gold"

    Then I'd set a local variable 'resource' to "Gold" at ChatArray.CurZ and local variable 'amount' to ChatArray.CurZ+1 and be able to manipulate the values from there.

    Does any of that make sense?

    At its most basic - how do I run a loop that searches a at a set X and a set Y position to see if there's a specific string (eg "gold") and, if there is, return that value to a local variable, and the value after it (ie 'the amount of gold as a number) to another variable.

    I'd link a .capx, but don't know how yet. Also, the event will look horrendous

    Thanks for any help you can offer!

    Dman

    There is possibly a bit of misconception of what array coordinates are on your part I'm afraid.

    In your original list :

    (0,0,0) Hi, want to stay at the inn?
    (1,0,0) Yes (10 Gold)
    (1,1,0) No (exit)[/code:28zps16j]
    
    Is read in Construct as Array.at(X, Y, Z)
    So ChatArray.At(0,0,0) is your question. The question is the value (text in this case) that is found at the coordinates ChatArray.at(0,0,0)
    
    So for your answers, you actually need to use a single location, but multiple possible values. Consider "Yes" is 1 and "No" is 0
    You can simply store 0 or 1 in ChatArray.At(0,1,0) (the second Y of your first X (remember this is zero-based).
    
    So you then use array conditions :
    
    Compare at X, Y, Z - X 0; Y 1; Z 0 = 0
    This event executes actions when the user answers "No" to staying in the inn.
    On the other hand, another event :
    Compare at X, Y, Z - X 0; Y 1; Z 0 = 1
    Will mean that the user wants to stay.
    
    From there, you can set the price in (0,1,1) and (0,1,2)
    Again, instead of storing actual "text" (for example "Gold") you can store a number for multiple values (0 is Gold, 1 is Copper, 2 is Silver, and so on)
    
    So when you
    Compare at X, Y, Z - X 0; Y 1; Z 1 = 0 
    You know you mean Gold, and will look to remove ChatArray.at(0,1,2) from your Gold variable.
    If Compare at X, Y, Z - X 0; Y 1; Z 1 = 1
    You might mean Copper, and so will look to remove ChatArray.at(0,1,2) from your Copper variable.
    
    And so on.
    Then, you can store in the next X (1,0,0) the next question/situation/prices.
    
    To be fair, third-dimensions arrays are pretty intricate and complicated. If you always know that you'll be dealing with prices or stuff of the like, possibly a simple two dimension array (just using X and Y coordinates) may perfectly do the job, adding more Y cells to each X.
  • nemezes : This suggestion has already been discussed I seem to recall.

    Can't remember where exactly. But if you are so used to English, keep with the English rather than translations.

    Translations will mostly be used by beginners and people who can't speak another language.

    Translations are confusing AF, but I'm not sure there is another way around them.

  • nemezes: Why don't you use English and the actual POEditor ?

    That sounds like a very strange way of doing things, especially since you translate out of an adaptation/translation, with the risks of translating "translated mistakes".

    In French "Random" is "Aléatoire".

    But as mentioned, in Construct 3, when inputing the field of an expression, the original expression in English will show up, not the translation. The translation will only be visible once the action has been validated and is appearing in the event sheet.

    So again, I don't think it is wise of you to translate Construct out of the French translation. The original language is English and is the root in POEditor and POEditor allows to easily see what strings translations are missing.

  • Consider posting your capx.

    It will be simpler to see directly your project to determine what may be going on/wrong.

  • A new instance cannot have the same Z as another already existing.

    Otherwise you could not precisely order instances in the Z Order Bar.

    I don't think this is a bug.

    Ashley, Nepeo, DiegoM any of you guys could confirm this theory please ?

  • Because you have set your event that updates the leaderboard in an event that is always true, so you are always sending informations to the leaderboard, instead of sending only once, at the end of your game.

    Modify the position of the action that sends the score in your capx so that it is happening in an event that does not execute each tick and the problem is solved.

  • the Mnk: Neither. People have lives.

    No more complicated explanation then that.

    A couple of months ago, there was no new third-part addon released during summer. Some people freaked out, when it was just a question of time of year and different interest for a while.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AJAX is supposed to work as long as you make the correct call to the correct URL.

    As usual, make sure to debug your application and check in the console what is going on to have actual error messages which gives actual clues.

    No one can just GUESS what the hell is going on.

    If you made your application using Phonegap, there is a Debug button that allows you to execute your application and review in the browser's console what may be going wrong.

    This is the first thing to look at and investigate the AJAX requests and answers.

    If you used a different way to compile your application, use the debug features offered by this way.

    Also, no need to alert me specifically, doing research on your own using the forums actually goes a longer way.

  • There used to be

    [tube]codeofvideo[/tube][/code:e4nlq0qx].
    
    I think it only works in the tutorials though, not in the forums.
  • In October 2017

    C2 New releases

    The features listed here are only the "highlighted" features for each release. Check each release page to see the complete changelog and comments for each version)

    Be sure to keep updated to the

    most recent release of Construct 2

    If you think you have found a bug in Construct 2 you can report it in this forum BUT

    • Make sure it is not already a reported bug by searching through the "Bugs" forum
    • Make sure it is not a bug in your events, a difference between what you have coded and what you would expect
    • Make sure you're using the very latest version of Construct 2 (beta possibly, stable if this is the very latest release available)
    • Attach a .capx of the issue in the simplest manner possible (no 100+ events capx, no 10 mb capx)
    • Make sure to read Bug report requirements before posting and provide all the required informations (your configuration, the steps to use to reproduce the bug, any relevant information you can provide)

    It is really important since about 50% of reports aren't bugs which takes time out of working on Construct2 directly.

    Be responsible, help everybody by making sure it's not your events in cause first.

    NW.JS

    • v0.26.0 (Chromium 62) [Requires r217+]
    • Get the latest and current version and make sure you are using the appropriate Construct 2 release : https://www.scirra.com/nwjs

    Third part addons

    WebGL effects

      No new WebGL FX this month
    • User Saiyadjin did a big job putting in place in July 2017 this google doc which attempts to add descriptions to add ons and effects and determine if they are up to date or not. You can check the document or check for yourself directly in the forums' topics.

    Blog posts

    A couple more months to 2017.

    And as mentioned in October's blog post by Ashley : "Construct 3 is still in beta, but we're increasingly confident with its reliability and we plan on making the full launch soon."

    See you next month !

  • You can check NW.JS in the "Installed programs" of your windows OS.

    Latest version of NW.JS will always be available at : https://www.scirra.com/nwjs

    To report bugs : ***MUST READ FIRST!*** Bug report REQUIREMENTS

    Issue does not happen when trying to export the provided Ghost Shooter in r248 with v0.26 nwjs.

    Possibly your issue lies with third-part addons in your project.

  • Siva2D :

  • As mentioned in the comments of the tutorial, is your server using PHP 7 ?

    If so, you need to modify a few lines of the script in order for it to correctly connect with your MySQL database.

    Note: Otherwise, check for errors in your browser, this will give exact clues as to what is going on.

  • Don't use XDK, it has been deprecated so it is not working anymore...

    Try using Phonegap instead.

    Export from C3 to Cordova. Possibly use Cordova CLI

    If there is still an issue, consider looking in the bug database if a similar issue exists, otherwise post your own report following the guideline.