lucid's Recent Forum Activity

  • mouse/keyboard object's condition Mouse is Over object condition ignores current picking with strange results:

    http://dl.dropbox.com/u/1013446/mousekeyboardglitch.cap

    the object variables are numbered 1 through 4

    the second condition picks the ones with less than 3 so two of them are faded to 50 opacity, then the check for mouseover should only activate if one of those semitransparent one's has the mouse over it. instead it adds anything not already picked into the picking list

    i will have a look at the runtime and see if i can find a way to fix this later, but if anyone has an idea how to fix this just using construct and the cap file, I'd appreciate it. I don't mind if I need extra pv's and global variables just to do some fake picking thing

  • thanks again. I pm'd you back about the updated runtimes. Also, if you could phrase what you did in a changelog friendly way I'll add it to the cc changelog

  • With regard to the number size issue. If you set a variable with an action you can use 15 digit numbers with no rounding.

    hmmm

    sounds like a bug really

    not being able to initialize to the same accuracy wouldn't be the expected behavior

  • Your link leads to no where, lucid =(

    thanks I fixed it:

    > Looking forward to this. Actually I was just playing a game on the iPad 2 called "Quest Runner" which seemed to using similar animations to this tool.

    hey cryptwalker, you may have already seen this, but there's been alot more news on this here:

    scirra.com/forum/spriter-multiimage-animation-coming-to-c2_topic44969.html[/url]

  • Looking forward to this. Actually I was just playing a game on the iPad 2 called "Quest Runner" which seemed to using similar animations to this tool.

    hey cryptwalker, you may have already seen this, but there's been alot more news on this here:

    scirra.com/forum/spriter-multiimage-animation-coming-to-c2_topic44969.html[/url]

  • <img src="smileys/smiley5.gif" border="0" align="middle" />

    Um.

    Maybe what I wanted to modify it for can use a simpler solution... <img src="smileys/smiley29.gif" border="0" align="middle" /> I just need to be able to go through a number and tell what each digit is individually. Is that as complicated to do?

    make sure it's a string and then just do mid(stringhere,index of character you want,1)

    because:

    mid(Text, Index, Length)

    your Text is your number in string form, the Index is what digit you want and the Length is 1 since you just want that 1 digit

  • ok

    apparently c2 doesn't allow very large numbers, because it kept rounding when I'd use a number global instead of text and convert it to a string.

    so first we set our global text variable to the number

    the we do a loop from 1 to len(number)/3

    len(number) is the length of the string,(called "number") as in, how many characters in the string divided by 3, because we want it in chunks of 3 for the comma

    xxx,xxx,xxx,xxx,etc

    then we have mid(number,len(number)-loopindex*3,3)&((loopindex>1)?",":"")&text.text

    this we will break down piece by piece, first we have:

    mid(Text, Index, Length)

    this will get you a substring of Text, beginning at character Index, for Length characters, so if you did

    mid("This string here", 3, 7)

    you would get

    "s strin"

    you started at the index 3 in the string (0,1,2,3), and took 7 letters with you

    so we have

    mid(number,len(number)-loopindex*3,3)

    our string is called "number" (to avoid confusion)

    number = "495825542"

    so we have mid("495825542",len("495825542")-loopindex*3,3)

    len(number) returns the number of letters in the string

    in this case 9, remember this parameter we're working on is the Index letter we want the substring to start on (   mid(Text, Index, Length) )

    so len("495825542") has 9 letters, so in this case it equals 9

    now we have

    mid("495825542",9-loopindex*3,3)

    loopindex*3 will start us on multiples of 3, but since we are minusing from 9 it will go from right to left:

    loopindex=1

    9-(1*3) = 6

    so we start on index 6 of "495825542"

    so we're on the last digit '5'

       "495825(5)42"

    and we are taking 3 characters "542"

    next loopindex would be:

    9-(2*3) = 3

    so "495(8)25542"

    and we take those 3 characters "825"

    etc

    we go from right to left, because if we have a number that's not divisible by 3, we don't want to have this

    678,45

    instead of

    67,845

    but the entire expression was:

    mid(number,len(number)-loopindex*3,3)&((loopindex>1)?",":"")&text.text

    so we have the mid() out of the way

    then we have &((loopindex>1)?",":"")

    this is a conditional operator:

    condition?if true:if false

    for instance if you did

    5>4?"true":"false"

    that expression would evaluate to "true" because the condition was true

    if you did

    5<4?"good":"bad"

    if would evaluate to "bad" because 5 is not less than 4

    in our expression:

    ((loopindex>1)?",":"")

    we check if loopindex is equal to 1 and if it is not we add a "," to our string, and if it is we add "" (nothing) to our string

    this is because once again we are working from right to left, and we don't want our numbers looking like this:

    100,000,   (with the extra comma at the end)

    instead of just

    100,000

    one more look at our expression:

    mid(number,len(number)-loopindex*3,3)&((loopindex>1)?",":"")&text.text

    at the end we have &text.text

    since we are doing the right side first we can't append to the end of the string

    we have to add to the beginning, so we are getting our three numbers &text.text to add what we already have to the right side of our our current expression

    after all that is over

    we do:

    "$"&text.text

    to add the dollarsign to the left of our current text

    make sense?

    EDIT: i just tested this with nondivisible by 3 numberlengths and it did not work correctly. so I reuploaded and it has one extra step:

    if (len(number)%3>0)

    % operator gives the remainder of a division problem

    like 9%3=0 because 9/3=3 with no remainder

    8%3=2 because 8/3=2 r2 (a remainder of two)

    so we want to know if the number of digits is divisible by 3

    if it is, there is no remainder, we don't want an extra comma in there, so we skip this step, if it is greater than 0 there are some digits leftover, but less than three, actually there are exactly len(number)%3 digits left over so we :

    set text to:

    left(number,len(number)%3)&","&text.text

    left is like mid but from the left side of the string

    left(Text, Count)

    so our Text is number

    and the number of characters we want(Count) is len(number)%3 because that's how many characters are leftover after our clever little *3 loop.

    then we add our "," and connect it to the rest of our number

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • http://dl.dropbox.com/u/1013446/moneytext.capx

    let me know if you need me to deconstruct it

  • the way it worked for cc, and I assume this will probably continue is that third party plugins will remain 3rd party plugins. this was for the free construct, so I'd imagine there'd be additional issues to consider now, but no real benefit. I mean, you just copy them to the folder if you want them, aside from that and whether you trust the third party to develop stable plugins, what difference would it really make?

  • ok

    update. if I remove the line from the previous post it doesn't crash. but I really need to be able to generate a collision mask.

    while I wait for a reply, I'll try to search for some releasecollision mask or increment of that. thanks for your help so far though

    I'll post back if I figure it out before you do

    edit: also removed the increment texture thing and works the same, no crash unless I try to generate a collision mask:

    localTex = (TextureHandle)param;

    info.w=localTex->image_widthf;

    info.h=localTex->image_heightf;

    pRuntime->UpdateBoundingBox(this);

    this works fine with no crashes

  • thank you rojo

    just recently changed something I can't seem to undo that made the problem worse. but when I debug.

    it seems to set the textures fine one time, for a new object,

    this is basically a modified sprite object that has localTex used for rendering instead of info.currenttexture

    also I just added the line at the top to increment reference. Not sure if that's how it's supposed to be done

    but it crashes on the highlighted line:

    pastebin.com/Hmqgzz3K

  • i construct each instance of the same sprite uses the same texturehandle. in the current plug I'm developing, if I have more than one object getting it's texture from the same handle, it crashes? any idea why? I'll try looking through the runtime code to figure out how sprite pulls it off, but any help would be appreciated.

    I can't see why, but I'm fairly certain it's the problem. basically I have a line of code that copies the texture to a new handle each time a new object will use it. if i remove that code and make them both refer to the same handle it crashes

    also, if it helps with the answer, the objects need to load an unknown amount of new textures off of disk at runtime, and share them amongst eachother

lucid's avatar

lucid

Member since 16 Jan, 2009

Twitter
lucid has 25 followers

Connect with lucid

Trophy Case

  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

24/44
How to earn trophies