Page 1 of 1

respawn

PostPosted: Wed May 30, 2012 9:07 pm
by hunter84
ive tried to get my character to respawn when he is shot and dies but i cant figure it out. can anyone help?

Re: respawn

PostPosted: Wed May 30, 2012 9:24 pm
by skydereign
We'll need to know a bit more about your setup. I tried to explain to you yesterday that unless we have your game in front of us (the ged and data) we can't actually give you a complete answer. I told you how to respawn the player actor when it gets hit by the bullet. You mentioned it didn't work, but I think the problem is that the view didn't move to where you recreated the player, or you recreated the player in the wrong spot. So, for instance if you wanted the player to respawn in the center of the view, you could use this.
Code: Select all
CreateActor("player", "stand_right", "(none)", "(none)", view.x+view.width/2, view.y+view.height/2, true);

That should work unless you have the view parented to the player.

Re: respawn

PostPosted: Fri Jun 01, 2012 3:50 am
by hunter84
i have. im not good with regions

Re: respawn

PostPosted: Fri Jun 01, 2012 4:34 am
by Chai
When your character die created another actor as timer for respawn your character.

for the code as manual timer
Code: Select all
if(var1>=60){createdActor...Your player Actor name....; DestroyActor(); }else{ var1++; }


don't forget to set timer actor transparency to be 0.99.

Re: respawn

PostPosted: Fri Jun 01, 2012 3:34 pm
by hunter84
ok i cant fix it so here is the ged.

Re: respawn

PostPosted: Fri Jun 01, 2012 5:25 pm
by skydereign
Ok, the first thing is you don't even have the create actor function call anymore. So, you aren't recreating the player at all. Next is when you do recreate the actor, you need to reparent the view to the player (since the player actor it was parented to was destroyed). To do this you can call the ChangeParent function, setting the view's parent to player.

Lastly, you'll need to move the view to wherever you respawn the player. Since you have now parented the view to the player, its coordinates are relative to the player, so all you need to do is set the view's x and y equal to (-300, -350).
Code: Select all
view.x=-300;
view.y=-250;


And all of that goes into the event you called DestroyActor.

Re: respawn

PostPosted: Fri Jun 01, 2012 5:37 pm
by hunter84
ok well since youve seen the begginning of the game what do you think?

Re: respawn

PostPosted: Fri Jun 01, 2012 7:03 pm
by DarkParadox
The problem was resolved/fixed/whatever you would like to say in the game-editor.net chatroom ( http://game-editor.net/index.php/chatroom ).

No need to worry about it anymore.
~Woo

Re: respawn

PostPosted: Fri Jun 01, 2012 7:07 pm
by hunter84
thanks again dark