Reply to Scripting problem
If you don't have an account, just leave the password field blank.
Why can't I get Dink to say the value of the variable in the below script?
when say("&x"); is called he says "x" with a line under the x instead of the value... and I'm 100 percent sure &x has a value!
I need to know the value of &x and &y to figure out another problem with the script, why the object nebver returns that it's inside the coordinates in check_p.
The pushing works fine.
Script:
when say("&x"); is called he says "x" with a line under the x instead of the value... and I'm 100 percent sure &x has a value!
I need to know the value of &x and &y to figure out another problem with the script, why the object nebver returns that it's inside the coordinates in check_p.
The pushing works fine.
Script:
void main (void)
{
int &x;
int &y;
&x = 100;
&y = 100;
int &junk;
int &dir1;
sp_speed(¤t_sprite, 5);
sp_brain(¤t_sprite, 0);
sp_x(¤t_sprite, &x);
sp_y(¤t_sprite, &y);
sp_hard(¤t_sprite, 0);
draw_hard_map();
}
void push(void)
{
freeze(1);
sp_hard(¤t_sprite, 1);
draw_hard_map();
&dir1 = sp_dir(1, -1);
if(&dir1 == 6)
{
&x = sp_x(¤t_sprite, -1);
&x += 20;
move_stop(¤t_sprite, 6, &x, 1);
}
if(&dir1 == 2)
{
&y = sp_y(¤t_sprite, -1);
&y += 20;
move_stop(¤t_sprite, 2, &y, 1);
}
if(&dir1 == 8)
{
&y = sp_y(¤t_sprite, -1);
&y -= 20;
move_stop(¤t_sprite, 8, &y, 1);
}
if(&dir1 == 4)
{
&x = sp_x(¤t_sprite, -1);
&x -= 20;
move_stop(¤t_sprite, 4, &x, 1);
}
say("&dir", 1);
sp_hard(¤t_sprite, 0);
unfreeze(1);
check_p();
}
void talk(void)
{
say("It's a stone", 1);
}
void check_p(void)
{
&x = sp_x(¤t_sprite, -1);
&y = sp_y(¤t_sprite, -1);
if (&x >= 221)
{
if (&x <= 272)
{
if (&y <= 304)
{
if (&y >= 268)
{
//I need to print the x and y
//to figure out why the script never gets here
say("It's inside!", 1);
goto skip;
}
}
}
}
say("&x", 1);
//Why doesn't that work?!
skip:
draw_hard_map();
}






