The Dink Network

Re: dink x and y

September 23rd 2009, 01:26 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
When I use a magic I want to create a sprite at dink run it's frames and die. ( the Sprite is a "Animation" for the heal spell.) There isn't a variable for dinks x and y, how can I create it at his current location?
September 23rd 2009, 01:46 PM
spike.gif
You can find his location by checking out the value of sp_x and sp_y.
int &dinkx = sp_x(1,-1);
int &dinky = sp_y(1,-1);
Then create the sprite at &dinkx and &dinky. -1 is a special value that returns what value an attribute has, it doesn't change it.
September 23rd 2009, 03:22 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Thanks, i'll try it tomorrow :]
September 24th 2009, 06:43 AM
burntree.gif
Fireball5
Peasant He/Him Australia
Let me heat that up for you... 
I never knew that trick...
September 24th 2009, 09:22 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
It doesn't work. The Sprite doesn't appear at all. When i change brain to 6, reapeat, the first frame appear but the seq doesn't run.

void use(void)
{
say("Cure!!", 1);
int &dinkx = sp_x(1,-1);
int &dinky = sp_y(1,-1);
create_sprite(&dinkx,&dinky,7,890,1);
&life += 5;
&life += &magic;
If (&life > &lifemax)
{
&life = &lifemax;
}
playsound(24,22050,0,0,0);
&magic_level = 0;
draw_status();

}
September 24th 2009, 10:25 AM
spike.gif
Try putting
sp_frame(&return,1);
right after the create_sprite command. IIRC, brain 6 should animate automatically, but the other brains need this to start.

If it doesn't animate even with brain 6, though, the problem is probably in the sequence/graphics.
September 24th 2009, 10:37 AM
fairy.gif
GlennGlenn
Peasant He/Him Norway
GlennGlenn doesn't want a custom title. 
Sequence 890 sounds like a sprite that doesn't exist or a sprite you've added yourself, that might be your problem
September 24th 2009, 10:44 AM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Still doesn't work.
If I add the sprite in windinkEdit and set the brain to 6 and base idle to 890 it run all scripts over and over again. But when created in script it just run first frame...
And... It's my own graphics...

Anyone know what to do? D:
September 24th 2009, 12:14 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
Should I give up? <.<