The Dink Network

block script

April 25th 2005, 11:23 AM
milder.gif
I am looking for a script that I can attach to a fence which is invisible. That dink can not walkthrough when &story <= 23.

Has anyone an example of that script or is it not possible?

Please help? Any how many void main (void) scripts can I let work in one screen? For example one with if &story <= 23 and one if &story > 23
April 25th 2005, 12:06 PM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
void main(void)
{
if (&story <= 23)
{
sp_touch_damage(&current_sprite, -1);
}
}

void touch(void)
{
say("...text...", 1);
move_stop(1, 2/4/6/8, coordinate, 1);
}

As for your void main(void) scripts, you can have one with if (&story <= 23) and one with if (&story > 23). It doesn't really matter, just remember that the void main(void) part runs when entering the screen so if there are various checks that are true, it'll run them at the same time, which could interfere if both control Dink's text and movement.
April 25th 2005, 12:11 PM
milder.gif
Which coordinate do you mean?

move_stop(1, 2/4/6/8, coordinate, 1);

2 and 8 the Y coordinate
4 and 6 the x coordinate

Am I right?
April 25th 2005, 12:12 PM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Yes, 2 and 8 are down and up respectively so they'd need a y-coordinate to stop at. 4 and 6 are left and right respectively so they'd need a x-coordinate to stop at.
April 25th 2005, 12:15 PM
milder.gif
Thank you. I will try to work with now. And I want to use it in more worlds of my dmod.
April 25th 2005, 03:54 PM
milder.gif
I am using this script and the &story is 22 in the game now.

void main (void)
{
if (&story <= 23)
{
sp_touch_damage(&current_sprite, -1);
}
}

void touch (void)
{
say("I am not ready yet.", 1);
move_stop(1, 2, 180, 1);
}

But the block doesn't work I can't walkthrough it and the script doesn't say "I am not ready yet" and it doesn't get me to y-coordinate 180.

I set its new type on 2, hardness 0 and script block1.

What is wrong?
April 25th 2005, 04:06 PM
milder.gif
Is there a global needed or something to make such a script working or is the &story not working well in my dmod.
April 25th 2005, 04:29 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Somehow invisible sprites don't run scripts. Add

sp_nodraw(&current_sprite, 1);

to the main proc.

Turn off the hardness (hardness 0 is hard, 1 is not hard).
April 25th 2005, 04:30 PM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
My block scripts are visible in the editor, have sp_nodraw(&current_sprite, 1); in their void main(void) script and have a hardness of 1 - that's also how the block script near Matridge's hut works in the original game.
April 25th 2005, 05:00 PM
milder.gif
Thank you guys it works now.
April 25th 2005, 07:07 PM
milder.gif
Now a weirdest thing happened. I tried it when &story was still 22.
But now I am playing it and &story is over 23 and the fence appears again but it doesn't block me anymore and I can walkthrough it now.

I changed the script in this one;
void main (void)
{
if (&story <= 23)
{
sp_touch_damage(&current_sprite, -1);
sp_nodraw(&current_sprite, 1);

}
}

void touch (void)
{
say("I am not ready yet.", 1);
move_stop(1, 2, 180, 1);
}

Why does the fence appears again? It works fine but the fence must be invisible.
April 25th 2005, 07:42 PM
milder.gif
I ran into a another problem. I want to make a map for pressing M with all my screens I have made. It will contains about 680 screens. The rest are inside houses and not usefull to see in a map.
But when I when I open frontend and press z and push spacebar and press alt-printscreen and paste it in paint, irfanview or paint shop pro I get it almost completely black and I can't turn it in the right colors. What am I doing wrong?
April 25th 2005, 07:50 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
You'll have to mess with the palette... which is a pain.

You could use another program to take the screenshot (like Fraps), or just use Windinkedit to do it.
April 25th 2005, 08:29 PM
milder.gif
The block script is working now. I was looking wrong.

And windinkedit; when I open my dmod in windinkedit I can't take a screenshot or whatever the options are in windinkedit al the options in the toolbar are lightgrey instead of darkgrey. So that doesn't work. But maybe it has to do with my computer. Because when I open my other dmod the ultimate challenge I can take a screenshot (but where can I look at that screenshot, I couldn't find it anywhere).
Is there something wrong with my new dmod then?
Is there a solution?
I will going to try other programs to make screenshots?
And of course try to make a map.
April 26th 2005, 02:14 PM
milder.gif
I have another question which script or let I ask the question different. How do you write a script that a sprite only appears when @story is for example 23.

Has anyone an example script of it?
April 26th 2005, 03:45 PM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
If you want to only let something happen under certain conditions (like in this case, &story needs to be 23), then use an if-statement:

//if the sprite doesn't exist
if (&story == 23)
{
int &crap = create_sprite(bla);
}

Or if the sprite already exists in the editor, you can also make it appear/not appear by using visions, then you need to attach a script to the screen itself (with the desired sprite on vision 1):

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