block script
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
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
void main(void)
{
if (&story <= 23)
{
sp_touch_damage(¤t_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.
{
if (&story <= 23)
{
sp_touch_damage(¤t_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.
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?
move_stop(1, 2/4/6/8, coordinate, 1);
2 and 8 the Y coordinate
4 and 6 the x coordinate
Am I right?
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.

Thank you. I will try to work with now. And I want to use it in more worlds of my dmod.
I am using this script and the &story is 22 in the game now.
void main (void)
{
if (&story <= 23)
{
sp_touch_damage(¤t_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?
void main (void)
{
if (&story <= 23)
{
sp_touch_damage(¤t_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?
Is there a global needed or something to make such a script working or is the &story not working well in my dmod.
Somehow invisible sprites don't run scripts. Add
sp_nodraw(¤t_sprite, 1);
to the main proc.
Turn off the hardness (hardness 0 is hard, 1 is not hard).
sp_nodraw(¤t_sprite, 1);
to the main proc.
Turn off the hardness (hardness 0 is hard, 1 is not hard).
My block scripts are visible in the editor, have sp_nodraw(¤t_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.
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(¤t_sprite, -1);
sp_nodraw(¤t_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.
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(¤t_sprite, -1);
sp_nodraw(¤t_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.
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?
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?
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.
You could use another program to take the screenshot (like Fraps), or just use Windinkedit to do it.
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.
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.
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?
Has anyone an example script of it?
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;
}
}
//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;
}
}