Author Topic: Mismade  (Read 4734 times)

0 Members and 1 Guest are viewing this topic.

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Mismade
« on: March 23, 2011, 04:19:33 pm »
Something is wrong here, because I seem to be creating the uservars improperly.
Code: [Select]
Zeros(9)->Z
GetCalc("varC")->A
float{A}->C
...stuff...
GetCalc("varW",18)->A
W->float{A}
This is just the relevant parts, although I am not sure if I left anything out that needs to be here.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Mismade
« Reply #1 on: March 23, 2011, 04:34:59 pm »
Something is wrong here, because I seem to be creating the uservars improperly.
Code: [Select]
Zeros(9)->Z
GetCalc("varC")->A
float{A}->C
...stuff...
GetCalc("varW",18)->A
W->float{A}
This is just the relevant parts, although I am not sure if I left anything out that needs to be here.

W (the Axe variable) doesn't seem to be defined.




Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Mismade
« Reply #2 on: March 23, 2011, 04:35:50 pm »
I think he's thinking that varC defines C and varW defines W.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Mismade
« Reply #3 on: March 23, 2011, 04:37:03 pm »
Maybe he was trying to do C->float{A}?




Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Mismade
« Reply #4 on: March 23, 2011, 04:40:28 pm »
No, I edited that part out. To give some context, this is a search engine for an AI I made, and W is one of the variables it returns, and no, it is not C.
« Last Edit: March 23, 2011, 04:44:02 pm by Freyaday »
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: Mismade
« Reply #5 on: March 23, 2011, 04:52:56 pm »
Something is wrong here, because I seem to be creating the uservars improperly.
Code: [Select]
Zeros(9)->Z
GetCalc("varC")->A
float{A}->C
...stuff...
GetCalc("varW",18)->A
W->float{A}
This is just the relevant parts, although I am not sure if I left anything out that needs to be here.
I used to have a similar problem, until Quigibo helped me.
First, you don't need to define a real var's size, it's always the same.

Second, when you reference a real var, you need to subtract 2 from the pointer.
So instead of this:
Code: [Select]
GetCalc("varW",18)->A
W->float{A}

Try this:
Code: [Select]
GetCalc("varW")->A
W->float{A-2}

I believe this should work.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Mismade
« Reply #6 on: March 23, 2011, 04:56:26 pm »
I used to have a similar problem, until Quigibo helped me.
First, you don't need to define a real var's size, it's always the same.

Second, when you reference a real var, you need to subtract 2 from the pointer.

Ah, so even though real vars don't have size bytes, Axe still adds two when returning a value with GetCalc(? That's a bug :-|




Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Mismade
« Reply #7 on: March 23, 2011, 05:00:22 pm »
I thought you had to subtract something. But if don't put the ,18 will Axe still know I'm trying to create the variable instead of find it?
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Mismade
« Reply #8 on: March 23, 2011, 05:15:43 pm »
Here are the things that seem odd/problematic to me:

  • What is Zeros(9)→Z for? It shouldn't cause any problems, but unless you actually use it anywhere, you don't need it.
  • Unlike most other variable types, float variables don't have a 2-byte header denoting their size. The GetCalc() routines unfortunately do not account for this, so they exhibit a number of problems when operating on float variables:
    • Using GetCalc() to either locate or create a float will expect a size header to be present and thus advance the pointer returned by 2 bytes. However, floats don't have this header and this advance shouldn't be made. This can be corrected for by subtracting 2 from the pointer returned from GetCalc() calls dealing with floats. Make sure to make this adjustment after checking whether or not the function was successful, though, so returned values of 0 indicating failure aren't changed to -2.
    • When creating a float, the GetCalc() routine will add an unwanted 2-byte size header. This effect can be negated by decreasing the size argument of the call by 2, so 9-2 for a real variable and 18-2 for a complex variable. I'm guessing you meant to create a real variable with GetCalc("varW",18) and just picked up the 18 from the memory management screen, but you really want 7. Unless you did mean to create a complex variable, in which case you want 16.


Here would be my suggested code for what I have interpreted as what you meant to do:

Code: [Select]
.Not sure what this line is for.
Zeros(9)→Z

.Don't forget error handling!
!If GetCalc("varC")
   .You'll want code here that either jumps to a unified error handler or handles the error itself and returns/quits.
End

.Unless you plan on using the pointer to the OS variable C later, no need to store the GetCalc() result to a variable, you can just carry it right into the float{} command. Also added a -2 to correct for GetCalc() problems.
float{-2}→C

...stuff...

.More error handling! Also changed the size argument to account for GetCalc() issues.
!If GetCalc("varW",9-2)
  .More error handling.
End

.Save the pointer to the OS variable because we can't just carry it straight into the float command this time. Also subtracted 2.
-2→A

.Store the Axe value W into the OS value W
W→float{A}

Hopefully this will work. Tell me if you have problems with it.
« Last Edit: March 23, 2011, 05:21:02 pm by Runer112 »

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: Mismade
« Reply #9 on: March 24, 2011, 01:02:04 am »
Now I have another problem (different pgrm)
This one is a sprite editor, but I can't get it to make the output string properly.
Code: [Select]
[303132343536373839414243444546]->GDB1
...muchness of stuff...
GetCalc("Str1",16)->A
For(N,0,1
0->B
For(P,0,15
For(Q,O,3
If pxl-test(P*4+Q^8+87,P*4+Q/8+46+(N*9
e^(3-Q)+B->B
End
End
{GDB1+B}->{A+P}
End
GetCalc("Str2",16)->A
End
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!