And this one doesnt work either...
void main(void)
{
int &rock = create_sprite(549, 39, 0, 95, 7);
int &rocky = create_sprite(446, 353, 0, 95, 7);
preload_seq(95);
}
void main(void)
{
if (&story == 9)
{
int &man = create_sprite(555, 23, 10, 381, 1);
preload_seq(381);
sp_base_walk(&man, 381);
sp_base_speed(&man, 1);
move_stop(&man, 2, 180, 0);
freeze(&man);
int &woman = create_sprite(525, 23, 10, 351, 1);
preload_seq(351);
sp_base_walk(&woman, 351);
sp_base_speed(&woman, 1);
move_stop(&woman, 2, 150, 0);
freeze(&woman);
int &giff = create_sprite(598, 89, 10, 411, 1);
preload_seq(411);
sp_base_walk(&giff, 411);
sp_base_speed(&giff, 1);
move_stop(&giff, 4, 40, 0);
freeze(&giff);
int &armor = create_sprite(596, 301, 10, 401, 1);
preload_seq(401);
sp_base_walk(&armor, 401);
sp_base_speed(&armor, 1);
move_stop(&armor, 4, 70, 0);
freeze(&armor);
freeze(1);
say_stop("`7Ok, armor, throw that weapon!", &giff);
wait(250);
say_stop("`1Ready?", &armor);
wait(250);
say_stop("`1FIRE IN THE HOLE!", &armor);
wait(10);
int &flame = create_sprite(425, 287, 6, 512, 1);
move_stop(&flame, 2, 800, 0);
sp_base_walk(&flame, 512);
sp_base_speed(&flame, 1);
}
}
Nothing happens when i run it...why?
{
int &rock = create_sprite(549, 39, 0, 95, 7);
int &rocky = create_sprite(446, 353, 0, 95, 7);
preload_seq(95);
}
void main(void)
{
if (&story == 9)
{
int &man = create_sprite(555, 23, 10, 381, 1);
preload_seq(381);
sp_base_walk(&man, 381);
sp_base_speed(&man, 1);
move_stop(&man, 2, 180, 0);
freeze(&man);
int &woman = create_sprite(525, 23, 10, 351, 1);
preload_seq(351);
sp_base_walk(&woman, 351);
sp_base_speed(&woman, 1);
move_stop(&woman, 2, 150, 0);
freeze(&woman);
int &giff = create_sprite(598, 89, 10, 411, 1);
preload_seq(411);
sp_base_walk(&giff, 411);
sp_base_speed(&giff, 1);
move_stop(&giff, 4, 40, 0);
freeze(&giff);
int &armor = create_sprite(596, 301, 10, 401, 1);
preload_seq(401);
sp_base_walk(&armor, 401);
sp_base_speed(&armor, 1);
move_stop(&armor, 4, 70, 0);
freeze(&armor);
freeze(1);
say_stop("`7Ok, armor, throw that weapon!", &giff);
wait(250);
say_stop("`1Ready?", &armor);
wait(250);
say_stop("`1FIRE IN THE HOLE!", &armor);
wait(10);
int &flame = create_sprite(425, 287, 6, 512, 1);
move_stop(&flame, 2, 800, 0);
sp_base_walk(&flame, 512);
sp_base_speed(&flame, 1);
}
}
Nothing happens when i run it...why?
Some things I've noticed wrong in your script..
1) You have 2 main procedures. You have to combine them into one.
2) It's sp_speed() not sp_base_speed().
3) You've set the speed and base walk for &flame after the actual movement.
I should also note that in most instances of move_stop() you should set the last number to 1 to ignore hardness. Otherwise, if the sprite does run into hardness, everything will come to a halt because the sprite cannot get to its destination.
1) You have 2 main procedures. You have to combine them into one.
2) It's sp_speed() not sp_base_speed().
3) You've set the speed and base walk for &flame after the actual movement.
I should also note that in most instances of move_stop() you should set the last number to 1 to ignore hardness. Otherwise, if the sprite does run into hardness, everything will come to a halt because the sprite cannot get to its destination.
4) You're best of doing the freeze(); before the move_stop(); command as well. The way it is now the sprite is not yet frozen when you tell it to move...
It's not really necessary because they're moved right after creation, they don't have time to stroll around...
For clarity's sake, here's a modified version of the script with the obvious problems fixed:
void main(void)
{
int &rock = create_sprite(549, 39, 0, 95, 7);
int &rocky = create_sprite(446, 353, 0, 95, 7);
preload_seq(95);
// Unnecessary (unless of course this is a different script than the one below)
// }
// void main(void)
// {
if (&story == 9)
{
int &man = create_sprite(555, 23, 10, 381, 1);
preload_seq(381);
//The walking animations in original Dink all use 10 as the base, so sp_base_walk() should always be 380, not 381 or 383 etc.
sp_base_walk(&man, 380);
//sp_speed(), not sp_base_speed()
sp_speed(&man, 1);
//The last number in move_stop() should be 1 instead of 0 so the the script won't freeze if the guy walks into something hard
move_stop(&man, 2, 180, 1);
freeze(&man);
int &woman = create_sprite(525, 23, 10, 351, 1);
preload_seq(351);
sp_base_walk(&woman, 350);
sp_speed(&woman, 1);
move_stop(&woman, 2, 150, 1);
freeze(&woman);
int &giff = create_sprite(598, 89, 10, 411, 1);
preload_seq(411);
sp_base_walk(&giff, 410);
sp_speed(&giff, 1);
move_stop(&giff, 4, 40, 1);
freeze(&giff);
int &armor = create_sprite(596, 301, 10, 401, 1);
preload_seq(401);
sp_base_walk(&armor, 400);
sp_speed(&armor, 1);
move_stop(&armor, 4, 70, 1);
freeze(&armor);
freeze(1);
say_stop("`7Ok, armor, throw that weapon!", &giff);
wait(250);
say_stop("`1Ready?", &armor);
wait(250);
say_stop("`1FIRE IN THE HOLE!", &armor);
wait(10);
int &flame = create_sprite(425, 287, 6, 512, 1);
// &flame doesn't need sp_base_walk because it's brain 6. Instead, use sp_seq(&flame,512) so the animation will start.
// sp_base_walk(&flame, 512);
sp_seq(&flame,512);
sp_speed(&flame, 1);
//Move AFTER giving the sprite it's speed
move_stop(&flame, 2, 800, 1);
}
}
For clarity's sake, here's a modified version of the script with the obvious problems fixed:
void main(void)
{
int &rock = create_sprite(549, 39, 0, 95, 7);
int &rocky = create_sprite(446, 353, 0, 95, 7);
preload_seq(95);
// Unnecessary (unless of course this is a different script than the one below)
// }
// void main(void)
// {
if (&story == 9)
{
int &man = create_sprite(555, 23, 10, 381, 1);
preload_seq(381);
//The walking animations in original Dink all use 10 as the base, so sp_base_walk() should always be 380, not 381 or 383 etc.
sp_base_walk(&man, 380);
//sp_speed(), not sp_base_speed()
sp_speed(&man, 1);
//The last number in move_stop() should be 1 instead of 0 so the the script won't freeze if the guy walks into something hard
move_stop(&man, 2, 180, 1);
freeze(&man);
int &woman = create_sprite(525, 23, 10, 351, 1);
preload_seq(351);
sp_base_walk(&woman, 350);
sp_speed(&woman, 1);
move_stop(&woman, 2, 150, 1);
freeze(&woman);
int &giff = create_sprite(598, 89, 10, 411, 1);
preload_seq(411);
sp_base_walk(&giff, 410);
sp_speed(&giff, 1);
move_stop(&giff, 4, 40, 1);
freeze(&giff);
int &armor = create_sprite(596, 301, 10, 401, 1);
preload_seq(401);
sp_base_walk(&armor, 400);
sp_speed(&armor, 1);
move_stop(&armor, 4, 70, 1);
freeze(&armor);
freeze(1);
say_stop("`7Ok, armor, throw that weapon!", &giff);
wait(250);
say_stop("`1Ready?", &armor);
wait(250);
say_stop("`1FIRE IN THE HOLE!", &armor);
wait(10);
int &flame = create_sprite(425, 287, 6, 512, 1);
// &flame doesn't need sp_base_walk because it's brain 6. Instead, use sp_seq(&flame,512) so the animation will start.
// sp_base_walk(&flame, 512);
sp_seq(&flame,512);
sp_speed(&flame, 1);
//Move AFTER giving the sprite it's speed
move_stop(&flame, 2, 800, 1);
}
}
a little advice, don't start a topic that is closly linked to another topic
a little advice, don't start a topic that is closly linked to another topic
Huh?
It works, but it doesnt create the rocks!
It should create them, at least the code is legit. Make sure you haven't done some mistake....?
If not, you could try adding a wait(1); at the beginning before creating the rocks. Sometimes, the game will just ignore the first line of code in a script. Also, the similar variable names (&rock and &rocky) might be causing some problems, try renaming them to &rock and &stone or something.
Huh?
It works, but it doesnt create the rocks!
It should create them, at least the code is legit. Make sure you haven't done some mistake....?
If not, you could try adding a wait(1); at the beginning before creating the rocks. Sometimes, the game will just ignore the first line of code in a script. Also, the similar variable names (&rock and &rocky) might be causing some problems, try renaming them to &rock and &stone or something.
The thing with the similar variable names was one of the fixes for v1.08 if I remember correctly. So it shouldn't cause problems anymore. Besides if that were a problem it would still create the rock. It would assign the spritenumber to the wrong variable, but the rock would still be created. In fact if you're not going to do anything to with the rock after placing it you could replace:
int &rock = create_sprite(549, 39, 0, 95, 7);
int &rocky = create_sprite(446, 353, 0, 95, 7);
with:
create_sprite(549, 39, 0, 95, 7);
create_sprite(446, 353, 0, 95, 7);
So something I can't explain is happening here. Doing a wait(1); command like scratcher said might be the best idea.
The second idea I have is to place the preload_seq(95); before creating the sprites instead of after creating them...
Oh, and I second the 'Huh?' comment...
int &rock = create_sprite(549, 39, 0, 95, 7);
int &rocky = create_sprite(446, 353, 0, 95, 7);
with:
create_sprite(549, 39, 0, 95, 7);
create_sprite(446, 353, 0, 95, 7);
So something I can't explain is happening here. Doing a wait(1); command like scratcher said might be the best idea.
The second idea I have is to place the preload_seq(95); before creating the sprites instead of after creating them...
Oh, and I second the 'Huh?' comment...
"a little advice, don't start a topic that is closly linked to another topic"
I think they mean since the topic in this thread basically refers to the topic of another, if they become separated on the board list, it will possibly cause confusion, but since 'This' in the topic isn't very descriptive anyway it probably doesn't really matter.
I think they mean since the topic in this thread basically refers to the topic of another, if they become separated on the board list, it will possibly cause confusion, but since 'This' in the topic isn't very descriptive anyway it probably doesn't really matter.