LittleStain's Forum Posts

  • like the author of the tutorial says using system expressions left, right, and mid

    https://www.scirra.com/manual/126/system-expressions

    example

    mid("thu apr 03",4,3) would give the text "apr"

  • This is what I had in mind for creating a simple list:

    List-Add-Dictionary-Function

  • >

    > > Sorry again, the Function Plugin :p

    > >

    > > My English.... I just cant!

    > >

    >

    > I thought you meant the function plugin, but I don't understand why it's not possible to use "complex expressions" in it..

    > I do it all the time..

    >

    Make a "How do I : Make a function with complex expressions", and I will make you an example when I get home from work. I will also show you how to use an array with a dictionary so you wont have to cast , and use tokens like you where suggesting to this new user.

    Maybe Ashley or someone else can answer before i am done with my work.

    Really surprises me how many people on the forums do not know about array. They are the backbone to programming. Most people learn about them the same time they learn about Str, Int, and Float.

    Don't worry, I know how to use arrays..

    I also know how to put them inside a container, so you can use them like instance variables..

    For something as simple as a list I prefer using the dictionary object with the possibility of adding to the string by append and creating a visual list with a simple function using tokencount and tokenat..

    I guess that's just personal preference..

  • Sorry again, the Function Plugin :p

    My English.... I just cant!

    I thought you meant the function plugin, but I don't understand why it's not possible to use "complex expressions" in it..

    I do it all the time..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You also can NOT do complex expressions in a function like grabbing tokens, you need to have global/instance variables set for the function to be able to access them.

    Could you explain this statement?

    Why wouldn't you be able to do this?

    Maybe you mean something else with "function" and/or "complex expressions", but I haven't run into this limitation..

  • What are the settings you used?

  • In C2 the Array variable is an Object,. You cant set a global array, nor can you make an array instance variable like in Scripting languages.

    Correct me if I'm wrong..

    Isn't an array set to global on creation?

    Wouldn't adding an array to a container work as using it as an instance variable?

    Maybe you mean something different, that's why I'm asking..

  • you could ofcourse easily create a fully customizable list using the TokenAt expression in combination with the dictionary object..

  • LittleStain i do as you say and i have this same problem again

    round( (cenakoncowa/100)*(100-RABAT) )&"zl"

    There are two places in the event-sheet which have the same event and action, are you changing both?

    I'm not sure why you have the same event twice, only difference is the top event..

    Using an 'or' event or a function-call would solve that..

  • You add "((" and "))" ??

    No, I added round() around the whole expression..

    The expression was

    (cenakoncowa/100)*(100-RABAT)

    so I added the bold part

    round( (cenakoncowa/100)*(100-RABAT) )

    This was done because I want to round everything inside the ( and the )

  • I set text to : round((cenakoncowa/100)*(100-RABAT))&"zł"

    And everything works as expected..

  • Not sure why that would happen (Maybe I'm missing something)

    Did you put round around the whole expression or just the first part?

  • C2 doesn't support making games that run in the background..

    When unfocused the game suspends..

    Using the "on resumed" event you could however update the game to what should have happened..

  • Sorry, but I don't understand the language and as such am not sure what should happen where..

    But I guess setting the text to : round((var3/100)*(100-var4)) should do the trick..

  • You're not stupid, you are learning..

    We all have to learn things before we can do them..

    An event like this would work:

    System for each (object you want to pin)

    (object you want to pin to) pick nearest to x = (object you want to pin).x , y= (object you want to pin).y

    (object you want to pin) pin to (object you want to pin to)

    This is if the object you want to pin to is the nearest instance to the object you want to pin..