The Dink Network

Push Rock

December 17th 2004, 10:09 AM
milder.gif
I am using this script but I want to push this when I am level 10. Which script do I have to use.

//Push North

void main(void)
{
int &dinkd;
int &newy;
int &myy = sp_y(&current_sprite,-1);

int &hold = sp_editor_num(&current_sprite);
&newy = editor_seq(&hold,-1);

if (&newy)
{
sp_y(&current_sprite,&newy);
draw_hard_map();
}

sp_speed(&current_sprite,2);
}

void push(void)
{
&dinkd = sp_dir(1,-1);
&newy = sp_y(&current_sprite,-1);

if (&newy != &myy) goto nopush;

if (&dinkd == 8)
{
freeze(1);
&newy -= 50;
move_stop(&current_sprite,8,&newy,1);
editor_seq(&hold,&newy);
draw_hard_map();
unfreeze(1);
return;
}
nopush:
say("I can't push it this way!", 1);
}

Now I am using this one. But I need a line which I put in. That I only push this rock away when I am level 10.

Which line must I attach in this script.

December 17th 2004, 11:08 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Add an if-statement that checks if Dink's level is 10. If you want it only to happen at level 10, it should be if (&level == 10) - if you want it to happen when Dink's level is at least 10, it should be if (&level >= 10) or if (&level > 9).

if (&level > 9)
{
//here add the code that disallows Dink to push (or ends the script so the push part doesn't get run)
}
December 17th 2004, 11:38 AM
milder.gif
Can I put "if (&level >= 10)" at any place in the script or must it be on a special line.
December 17th 2004, 12:13 PM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
You must realise the script runs from line 1 to the last one, so it gets run in the order you put the lines. So you must place it where you want the game to check what Dink's level is. If you put if after the push actions, it'll check Dink's level then which is too late - so you need to put it a bit at the beginning.
December 20th 2004, 06:51 AM
milder.gif
I am using this one. But I can not push the rock when I am level 10. When I am not level 10 but a lower level. When I push it It says I am not strong enough. But when I am level 10. I can not push the rock.

I have been busy with this script all weekend. And I made so many combinations. But I can not make the script work. Please help?

//Remember where it was pushed

void main(void)
{
int &dinkd;
int &newy;
int &myy = sp_y(&current_sprite,-1);

int &hold = sp_editor_num(&current_sprite);
&newy = editor_seq(&hold,-1);

if (&newy)
{
sp_y(&current_sprite,&newy);
draw_hard_map();
}

{
sp_speed(&current_sprite,2);
}


void push(void)
{
&dinkd = sp_dir(1,-1);
&newy = sp_y(&current_sprite,-1);

if (&newy != &myy) goto nopush;

if (&level >= 10)
{
unfreeze(1);
&newy -= 50;
move_stop(&current_sprite,8,&newy,1);
editor_seq(&hold,&newy);
draw_hard_map();
unfreeze(1);
return;
}
nopush:
say("I can't push it this way! I am not strong enough yet.", 1);
}
December 20th 2004, 07:09 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
In any case, there are crappy brackets again. Here it comes:

void main(void)
{
//This one was good, since it's for opening the main proc
int &dinkd;
int &newy;
int &myy = sp_y(¤t_sprite,-1);

int &hold = sp_editor_num(¤t_sprite);
&newy = editor_seq(&hold,-1);

//Next line: If &newy what? You must add a condition.
if (&newy)
{
//Bracket okay
sp_y(¤t_sprite,&newy);
draw_hard_map();
}
//Bracket again okay

{
//What are these for? I think you can kill it, if it's meant as an else, you must put "else" after the previous bracket and before this one.
sp_speed(¤t_sprite,2);
}
//Same story here

//Huh? The main proc isn't closed... You must add a bracket here:

}

void push(void)
{
//Yay, opening the push proc
&dinkd = sp_dir(1,-1);
&newy = sp_y(¤t_sprite,-1);

if (&newy != &myy) goto nopush;
//I'm not exactly sure if you can use if in this way. To be sure it works, you must put goto nopush; on a new line with opening brackets on the line before, and closing brackets on the line after.

if (&level >= 10)
{
//Brackets okay
unfreeze(1);
//I think you meant freeze(1);
&newy -= 50;
move_stop(¤t_sprite,8,&newy,1);
editor_seq(&hold,&newy);
draw_hard_map();
unfreeze(1);
return;
}
//Yay, closing the if-statement

nopush:
say("I can't push it this way! I am not strong enough yet.", 1);

//And here we're closing the push proc
}

Another question. Why did you create the &dinkd? It's only set to Dinks direction, but it's never checked, nor otherwise used.
December 20th 2004, 08:30 AM
milder.gif
What the hell is a bracket?
December 20th 2004, 08:44 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
opening bracket:

{

closing bracket:

}

In Dutch "haakje" or in this case "accolade"
December 22nd 2004, 11:15 AM
milder.gif
Ok I will try it. THanks.

For people who want a hint of the Dmod.
THe name of the dmod is THE ULTIMATE CHALLENGE.

When is a dmod not a romp, but a quest or epic.
I have already quite a few screens. And I have about a 100 screens now. And I haven't completed the rest yet. I think there will be another 75 screens. In what category will the dmod put into. Romp, quest or epic.
December 22nd 2004, 11:30 AM
spike.gif
Romp takes less than an hour to beat, quest a few hours and an epic about the same or more than the original Dink.
December 22nd 2004, 11:35 AM
milder.gif
ok