The Dink Network

Few things id like help on

August 11th 2012, 11:48 PM
knightgl.gif
zeddexx
Peasant He/Him New Zealand
I'm pretty sure I'm worth atleast SIX goats... 
first, is there a simple way to make text rise from dinks head, like it does when you get exp?

Second, i highly doubt there is, but is there a way to change visions without leaving the screen?

third, i love you <3
August 11th 2012, 11:51 PM
wizardg.gif
I believe there is a force_vision command.

edit: Yes there is.

force_vision( int new_vision );

"It kills all scripts and sprites and reconstructs them using the new vision. It also makes the script being run stay alive by connecting it to sprite 1000 (script never dies). You must use Kill_this_task(); or it will NEVER die."
August 11th 2012, 11:58 PM
wizardg.gif
I am unsure of how to do the first one easily.
August 12th 2012, 12:00 AM
custom_msdink.png
MsDink
Peasant She/Her New Zealand
Tag - Umm.. tag, you're it? 
cant u redraw the screen and that changes the vision?
August 12th 2012, 12:25 AM
pillbug.gif
pillbug
Peasant He/Him United States
Love! True love! 
1) I suppose you could do something like...
int &x = sp_x(1, -1);
int &y = sp_y(1, -1);
&y -= 30;
//These are Dink's coordinates. I subtracted 30 from the y-value so the text is up higher, but you'll have to tweak //it for it to look right.
int &text = say_xy("`%300 WAFFLES",&x, &y);
sp_kill(&text, 1000);
&y -= 50;
move(&text, 8, &y, 1);

I kind of threw that together, but basically what happens is: We get Dink's coordinates, and subtract from the y-value so the text is higher. You'll need to fine tune that. Then we create text (in this case "300 WAFFLES") at said coordinates. We set sp_kill to 1000, so that it dies in 1 second. Then we subtracted another 50 from the y-value so the text will have a place to go when we move it. Some of that might not work, like I said, it was just of the top of my head and there may be a better way.

2) My video tutorial on visions (I never posted it here so it's just sitting on my YouTube channel) covers changing visions without leaving the screen, but the gist of it is:

You change the variable to whatever is needed for the new vision, say &story = 1; The screen needs a script with if-statements for visions, just like normal vision changing. Then you load and draw the screen, and it will change to the new vision. Example:

//screen
void main(void)
{
if(&story == 1)
{
&vision = 1;
}
}

//sprite to talk to
void talk(void)
{
say_stop("Oh hey bro, I'll go ahead and change your vision.",¤t_sprite);
&story = 1;
load_screen();
draw_screen();
}
}


3) I<3U2
August 12th 2012, 03:52 AM
wizardg.gif
Paul
Peasant He/Him United States
 
Unfortunately force_vision() doesn't work like it should. All it does is reload the screen. The number you put in it apparently has no effect at all.

But what pillbug said should work well enough.
August 12th 2012, 04:22 AM
knightgl.gif
zeddexx
Peasant He/Him New Zealand
I'm pretty sure I'm worth atleast SIX goats... 
awwwwwww you guys are so awesome.

I'll try out your suggestions thanks guys
August 12th 2012, 08:28 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
When you say force_vision() reloads the screen, does it also reload base script? And does it reset the local variables?
August 12th 2012, 09:45 AM
wizardg.gif
Well I have never used force_vision before. I just figured since it says, "force_vision" it would force a vision. I guess DinkC is far less convenient than that.
August 12th 2012, 10:09 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
That WAS its original function but it never worked that way and was never fixed.
August 12th 2012, 10:39 AM
wizardg.gif
Paul
Peasant He/Him United States
 
My understanding was that it's pretty much identical in effect to draw_screen(). So yes, that would include re-running all the scripts.
August 12th 2012, 12:19 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
So, setting vision to 1 and THEN using force_vision() will work? xD
August 12th 2012, 05:07 PM
wizardg.gif
Paul
Peasant He/Him United States
 
Nope. Apparently &vision gets reset to zero early in the screen draw procedure, so the only way to make it actually do anything is to change during the screen draw process, i.e. in the screen's base script.

It just occurred to me that it might also work if you set it in the main function of a script on a sprite. However upon testing this I got a very weird result. It didn't change which sprites were drawn, but it did make the entire screen hard. what.
August 12th 2012, 05:11 PM
wizardg.gif
It didn't change which sprites were drawn, but it did make the entire screen hard. what.

That could be useful…… never?