MasterNedyah's Forum Posts

  • I followed the tutorial for 'Taking screenshots'. Here is the link.

    I am not sure what to do next. Please be specific and detailed in response. I am new to the Share object.

    Thanks!

  • I will give each a try. Thanks for the suggestions!

  • GlobalVariable called CurrentGroup:A

    Other Global Variables associated with CurrentGroup variable.

    A1:8

    A2:120

    A3:275

    B1:5

    B2:160

    B3:210

    C1:3

    C2:155

    C3:265

    And so on....

    I have a variable that identifies the current group, called CurrentGroup. This variable and the other variables change depending on the users. It could say B or C or D or so on.

    Each group has measuring variables. So (A or B or C)1 measure the same thing, 2 measures the same thing and so on. Because each group is different they return different numbers (as shown above).

    I started with

    Set GlobalVariable to CurrentGroup & 3. This returns A3 in a string.

    But I need it to return the number. In this case, it is 275 (which is A3 number).

    Is this possible?

  • Thanks for everyones help! It worked:)

  • I have an array(X) filled with numbers.

    Example

    1 5 7 8 15 2 20 15 7 15 55 15 25

    The array will add or take away cells which change the location of the number

    Example

    1 5 32 7 8 15 2 17 20 15 7 15 55 72 15 25

    Let's say I wanted to grab the location of the second 15. I know how to access the first and last. How would I do locate the second, or in some cases the third (but not last)?

  • I have multiple panels that open and close. When a user opens a panel they have previously used, I want the scroll button and the panel to be where it last was. The panel has objects that move with touch panel and scroll button with bar.

    I was using RexRainbow's simulate touch plug-in but it doesn't work with C3. I had it working with the plug-in.

    Here is what it was:

    Event: variable=PanelOpenTrue

    Action: SimulateKeyEvent Simulate touch:ButtonX start at (variablelastlocation, Scrollbar.Y) on layer Panel1.Layername

    Action: System wait 0.05 seconds

    Action: SimulateKeyEvent Simulate touch:Button.Active end

    Button has variable named Active.

    I am running into the problem of the button moving but the touch panel is not moving with the button. Once I click on the button the panel moves into the correction position. This is why I need a user simulated touch.

    How can I do this in C3?

    Note: sometimes the panels have new content requiring objects in panel to be destroyed on close panel and then objects created on open panel.

  • On function FUNCTION 1

    subevent: Array -- For each X element

    subevent: System -- Array.CurValue > 0 Action: Add Array.CurValue to globalvariable

    subevent: Empty Action: Call FUNCTION 2

    The for each X element event is not completely finishing before calling Function 2. I am not sure what condition to use to prevent this from happening.

    I have tried an else event but that did not work.

    Note: the values in the array are unpredictable.

  • I have an Array with different numbers. I need to search the array for the highest number without reordering. I also need to know which cell has the highest number. For some reason, the global variables remain at 0 when I use this code. What am I doing wrong?

    globalvariableValue=0

    Event: Array For each X element

    Sub-Event: Array Current value > globalvariableValue

    Action: Set globalvariableCell to Array.CurX

    Action: Set globalvariableValue to Array.CurValue

    I have tried Array Value at Array.X > globalvariableValue.

    I have also tried System compare values Array.CurValue > globalvariableValue

  • Thank you for the information! I think I have it almost working except I can't seem to get this line to work.

    set w to text.textWidth(tokenat(line, loopindex, “ “))

    When I type this it says does not take parameters.

    I am new to some concepts so I may be doing something wrong. This is what I am trying to do.

    CONDITION:SYSTEM Repeat tokencount(line, “ “) times THIS WORKS

    ACTION:SYSTEM set w to text.textWidth(tokenat(line, loopindex, “ “)) THIS DOES NOT WORK

  • Starts off with:

    Everything works up to the point. What I need a line count based on the text wrap or line break.

    Using tokencount(TextObject.Text,newline) won't work.

    Instead of counting the breaks it returns how many lines in the .txt file.

    Result

    Example1 variable = 2

    Example2 variable = 2

    Example3 variable = 2

    The result I am looking for is

    Example1 variable = 5

    Example2 variable = 2

    Example3 variable = 3

    Is there javascript I could use to recognize when a word is wrapped to the next line? I have read other forums with examples using Mutations to observe a change in the text but I am a beginner with Javascript so I don't fully understand the script.

    Note: I just need to count the number of wraps. I have a workaround for text height, width, etc.

  • I tried using this but Construct says: 'return' outside of function. I have the script placed inside a function.

    {var gTextLines = bbcodetext1.split("\n")

    return split.length}

    I have tried it without the brackets.

  • Do you by chance have any suggestions for javascript? I tried using this but it didn't work.

    var globalvariable = TextObject.split("\n")

    Note: I just need to count the number of wraps. I have a workaround for text height, width, etc.

  • Starts off with:

    Everything works up to the point. What I need a line count based on the text wrap or line break.

    I have used set globalvariable to tokencount(TextObject.Text,newline)

    Instead of counting the breaks it returns how many lines in the .txt file.

    Result

    Example1 = 2

    Example2 = 2

    Example3 = 2

    The result I am looking for is

    Example1 = 5

    Example2 = 2

    Example3 = 3

    How do a line count based on text wrap/line break?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you for the clarification. It worked:) Thank you so much!!

    Sprite is just the Construct default name. I plan to change it.

  • For some reason it is not working. I used the latest beta version (r162.2). I used the code below.

    const Sprite = runtime.objects.Text;

    const TextObject = Sprite.getFirstPickedInstance();

    TextObject.horizontalAlign="center";

    Any suggestions?