The Dink Network

Rilian's Profile

sob_scorpr.gif
Rilian
Peasant United States
 
Yosh. I'm a new member, I want to try making my own computer game at some point.

E-Mail glumbelf@hotmail.com
Private Message

2010-10-28 19:25:43
sob_scorpr.gif
Rilian
Peasant United States
 
Hm, alright. Here's the scenario:

I have two sprites walking back and forth and making periodic comments. One of the sprites walks left and right, the total distance is randomly determined, and the speak procedure is also random. The procedure is looped in the main of that sprite.

Another sprite is walking up and down, doing the same thing (making random statements).

When you touch a particular sprite, the one that is walking up and down freezes, and talks to you, meanwhile the other is supposed to continue in the back unabated. Instead, what happens is the one that is walking left and right doesn't turn around, it keeps going and ends up on the other side of the screen, at which point it continues merrily along doing what it was originally doing. Here are the appropriate scripts:

[Left and right walker. Basewalk etc. are determined in WDE. The code has been modified so that the character is not walking random distances.]

void main(void)
{
int &sy = 0;
int &wt;
&save_x = sp_x(&current_sprite, -1);
sp_speed(&current_sprite,4);

mov:
&wt = random(1000, 0);
wait(&wt);
&save_x -= 20;
move_stop(&current_sprite, 4, &save_x, 1);
&save_x += 20;
wait(10);

&sy = random(3, 1);
if (&sy == 1)
{
say_stop_npc("`3stuff", &current_sprite);
} else
{
if (&sy == 2)
{
say_stop_npc("`3stuff", &current_sprite);
} else
{
say_stop_npc("`3stuff", &current_sprite);
}
}

&wt = random(1000, 0);
wait(&wt);
move_stop(&current_sprite, 6, &save_x, 1);
wait(10);
&sy = random(3, 1);

if (&sy == 1)
{
say_stop_npc("`3stuff", &current_sprite);
} else
{
if (&sy == 2)
{
say_stop_npc("`3stuff", &current_sprite);
} else
{
say_stop_npc("`3stuff", &current_sprite);
}
}

goto mov;

}

[Script attached to item - touch script]

void main(void)
{
int &whob = sp(22); //Up and down walker. Will be talking.
int &said = 1;
int &ss = sp_seq(&whob, -1);
int &sf = sp_frame(&whob, -1);
int &temp = 0;
int &scrpt;
sp_touch_damage(&current_sprite, -1);

}

void touch(void)
{
sp_touch_damage(&current_sprite, 0);
freeze(1);
freeze(&whob);
sp_speed(&prsna, 0); //&prsna is the left-right walker. I am freezing it
//because it does wierd things if I don't.
sp_script(&whob, "blnk"); //
sp_script(&prsna, "blnk"); // This blank script is being attached because
//... the sprite will walk off the screen without it.

sp_speed(&whob, 0);
wait(10);
&save_x = sp_x(&whob, -1);
wait(10);
&save_y = sp_y(&whob, -1);
wait(10);
sp_speed(&whob, 2);
wait(10);
sp_base_walk(&whob, 350);
wait(10);
if (&save_y < 150)
{
move_stop(&whob, 2, 157, 1);
}
wait(10);
sp_dir(&whob, 4);
wait(10);
say_stop("`0stuff", &whob);
wait(10);
sp_dir(1, 6);

say_stop("stuff!", 1);
wait(100);
say_stop("`0stuff,", &whob);
wait(100);
say_stop("`0stuff.", &whob);
wait(100);
say_stop("`0stuff,", &whob);
wait(100);
say_stop("`0stuff!", &whob);
wait(100);
say_stop("stuff!", 1);
&save_y = sp_y(1, -1);
&save_y += 10;
move(1, 2, &save_y, 1);
wait(100);
&said = 2;
unfreeze(1);
unfreeze(&whob);


sp_script(&whob, "cstl_cook");


wait(10);
sp_speed(&whob, 2);
wait(10);

sp_kill(&prsna, 1); //re-creating the left-and-right walker because I attached
// The blank script.
if (&msc == 1)
{
&prsna = create_sprite(164, 141, 0, 353, 1);
sp_speed(&prsna, 2);
sp_base_walk(&prsna, 350);
sp_speed(&prsna, 2);
sp_script(&prsna, "cstl_cookb2");
} else
{
if (&msc == 2)
{
&prsna = create_sprite(477, 141, 0, 353, 1);
sp_speed(&prsna, 2);
sp_base_walk(&prsna, 350);
sp_speed(&prsna, 2);
sp_script(&prsna, "cstl_cookb1");

} else
{
if (&msc == 3)
{
&prsna = create_sprite(165, 65, 0, 353, 1);
sp_speed(&prsna, 2);
sp_base_walk(&prsna, 350);
sp_speed(&prsna, 2);
sp_script(&prsna, "cstl_cookb4");
} else
{
&prsna = create_sprite(477, 65, 0, 353, 1);
sp_speed(&prsna, 2);
sp_base_walk(&prsna, 350);
sp_speed(&prsna, 2);
sp_script(&prsna, "cstl_cookb3");

}
}
}

sp_touch_damage(&current_sprite, -1);

}

To solve the problem I temporarily attached a blank procedure to it, then after the touch procedure is run, I kill the sprite, recreate it, and attach the appropriate script to it again. This works but I would rather not have to do it at all.

Rilian has released 1 file

TitleCategoryAvgUpdated
Red Spider GraphicsDevelopment, GraphicsGood 7.0July 29th, 2010

Rilian has written 1 review

TitleFileTypeScoreDate
Buildings/Houses graphics by IPD Buildings/Houses GraphicsNormalExceptional 9.5January 9th, 2011

Rilian has taken 2 screenshots

ScreenshotFileDate
Preview Buildings/Houses GraphicsJanuary 9th, 2011
Preview Buildings/Houses GraphicsJanuary 9th, 2011