Author
|
Topic: c++
|
NeonWaters |
posted 04-01- 10:23 PM CT (US)
How in dink can I add. I know I can say &my_bob = 4; but what if I wont to add to that: &my_bob = &my_bob + 3; &my_bob++;
|
NeonWaters
|
posted 04-02- 09:22 AM CT (US)
This wont work: if(&spot_dir == 2) { &spot_y = &spot_y - 6; sp_x(1, &spot_x); sp_y(1, &spot_y); sp_dir(1,2); } It still puts dink in the same spot he left from when I warp him back. This then just sends him back. No good. How do I make it - 6 from &spot_y. Every thing else works just fine. |
redink1
|
posted 04-03- 12:35 PM CT (US)
You're doing the math equations wrong. To subtract 6 from &spot_y, you would do this:&spot_y -= 6; |
NeonWaters
|
posted 04-03- 06:02 PM CT (US)
I tried that and it wont work. I think it is because &spot_y is not just any normal ver. I guess I am going to have to do it the hard way. |
NeonWaters
|
posted 04-03- 09:44 PM CT (US)
I have tried: &spot_y = &spot_y - 6; and, &spot_y-=6; and, &spot_y = sp_y(1, &spot_y) - sp_y(1, 6); and even, &spot_yy = sp_y(1, 6); &spot_y = &spot_y - &spot_yy; I think I am going to have to do it the hard way. I will just make a formula to move him off of the x and y of the item. I will have to input each items x and y but at least it will work. |
Mr_Ace
|
posted 04-23- 11:38 AM CT (US)
I'm not sure, but i thoguht there had to bee spaces before and after the equal signs. |
Nexis
|
posted 05-04- 03:40 AM CT (US)
Ok...this should not ever be done.&spot_y-=6; &spot_yy = sp_y(1, 6); using &spot_y and &spot_yy in the same script. Why? Because of a huge bug in the dink engine that Seth never fixed. Say you try using &spot_yy, it will actually take &spot_y instead since the &spot_y is contained within &spot_yy. So you won't change &spot_yy, you'll change &spot_y instead. Your actual problem may have to do with having another variable called like &spot or something like that.
|
Wyndo
|
posted 05-09- 03:18 PM CT (US)
How many characters ARE unique? Anything up to the underscore character? Because if it's just spot_y being contained in spot_yy, then wouldn't the variable "spo" be confused for "spot_y" because it's contained? |
Nexis
|
posted 05-09- 08:01 PM CT (US)
Ok, think of it this way. When the parser is identifying which variable is which it keeps checking the characters starting from the left until it finds one that matches, and doesn't check if there are any characters after that which would disqualify that variable.So if it's trying to identify what variable &spot_yy is it will check until it gets to the first y and notice that there is a variable that matches it in the "database" called &spot_y. What it does with the extra 'y' I don't know. |
Wyndo
|
posted 05-11- 02:04 PM CT (US)
I understand that completely, but my question is if you have the variable &s, is it going to assume that *any* variable that starts with "s" is the one you're looking for, because it finds "s" (the complete variable) as the first portion of another variable? |
Nexis
|
posted 05-13- 04:35 AM CT (US)
Yes, that's exactly what I'm saying it will do. Any other variable that starts with s (might only be after the variable is declared, not sure) will automatically refer to &s instead. |