Page 2 of 2

PostPosted: Thu Apr 26, 2007 2:27 am
by Sgt. Sparky

seriously now:

PostPosted: Thu Apr 26, 2007 4:54 am
by d-soldier
Getting very frustrated...

I HAVE
* a variable called "Alive" (tried both global and actor)
* Create Actor (and tried Draw Actor) for player:
Alive=1; (tried Alive==1; just in case)
* Destroy Actor script for player:
Alive=0; (tried Alive==0; just in case)
* A smooth moving (not drawn)actor (named: ViewTarget) that follows the player(which the view is parented to)
* A draw actor script (for ViewTarget actor) with the following:

int weight = 10;
if(Alive==1)
{
x = ((weight -1)*x + player.x)/weight;
y = ((weight -1)*y + player.y -25)/weight;
}
else if(Alive==0) //also tried a plain if too
{
x = ((weight -1)*x + player_die_l.x||player_die_r.x)/weight;
y = ((weight -1)*y + player_die_l.y||player_die_r.y -25)/weight;
}

(The player_die_r/player_die_l is a dying player animation(actor)created in the destroy actor event of the player...)

NOTHING HAPPENS WHEN THE PLAYER DIES! The view follows the "ViewTarget" actor which follows the now destroyed (invisible)player back to x0y0 location on the map in a quick swooshing motion, instead of staying with the dead player actor.

PostPosted: Thu Apr 26, 2007 10:32 pm
by Sgt. Sparky
try this
Code: Select all
int weight;
weight = 10;
if(Alive == 1)
{
x = ((weight -1)*x + player.x) /weight;
y = ((weight -1)*y + player.y -25) /weight;
}
if(Alive == 0)
{
x = ((weight -1)*x + player_die_l.x) /weight;
y = ((weight -1)*y + player_die_l.y -25) /weight;
}

I do not know what the problem is, I am very busy with a few other things to. :(

PostPosted: Fri Apr 27, 2007 3:48 am
by d-soldier
Nope... nothing changes. Look, apparently this cant be done? I cant use parenting because the background stuff would have the same z-depth as what it's supposed to follow... So apparently I have to use move-to actions?!? ... dissapointing.... :(

PostPosted: Fri Apr 27, 2007 2:12 pm
by Sgt. Sparky
do not use parenting! :lol:
just use x= and y= stuff. :)
hey,
did you change all the code for all your BG's?
if this does not work e-mail me the .ged and data,
I will fix the problem,
then if you want I will send the .ged and data back to you,
or I will just tell you what you need to do.
:D

(I sometimes fix problems this way.)