Help Killing My Player (right)

Game Editor comments and discussion.

Postby Sgt. Sparky » Thu Apr 26, 2007 2:27 am

Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

seriously now:

Postby d-soldier » Thu Apr 26, 2007 4:54 am

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.
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Sgt. Sparky » Thu Apr 26, 2007 10:32 pm

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. :(
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby d-soldier » Fri Apr 27, 2007 3:48 am

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.... :(
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Sgt. Sparky » Fri Apr 27, 2007 2:12 pm

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.)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Previous

Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron