respowning?

Game Editor comments and discussion.

respowning?

Postby hunter84 » Thu Nov 10, 2011 4:13 pm

how do you get the player to respown after dying?
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: respowning?

Postby RippeR7420 » Thu Nov 10, 2011 10:31 pm

There is a couple different ways to do this, One; You can set up checkpoints.
Here is a Tutorial on how to do that:

http://www.youtube.com/watch?v=XQ64cNJui04

Another way you could probably do it is, Create a variable called like "RESPAWN" or something.
In the Player Actor make an event CreateActor->ScriptEditor->

Code: Select all
RESPAWN=0;


Put another event(Pretty sure it doesn't matter which actor, but not positive) -> DrawActor->ScriptEditor->

Code: Select all
if(RESPAWN==1)
{
       CreateActor("Player", "PlayerStandRight", "(none)", "(none)", 240, 160, false);\\ Change the "240" and "160" depending on where you want him to spawn
       RESPAWN=0;
       MoveTo("view", 0.000000, 0.000000, 500.000000, "Game Center", "");


and that should Re-create the player at the beginning of the level, and move the view there also..
Hope I helped you, and If you need anymore help just ask :)
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: respowning?

Postby hunter84 » Fri Nov 11, 2011 12:16 am

it says error line 3: expected ;
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: respowning?

Postby skydereign » Fri Nov 11, 2011 12:23 am

You need to add an ending } (after the MoveTo line). And make sure the comment doesn't fold over into a new line.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: respowning?

Postby hunter84 » Fri Nov 11, 2011 12:28 am

after the move to line I did add a } but it still says error: expected ;
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: respowning?

Postby skydereign » Fri Nov 11, 2011 1:01 am

Oh, they used \\. Switch the \\ to //. So this.
Code: Select all
if(RESPAWN==1)
{
       CreateActor("Player", "PlayerStandRight", "(none)", "(none)", 240, 160, false);// Change the "240" and "160" depending on where you want him to spawn
       RESPAWN=0;
       MoveTo("view", 0.000000, 0.000000, 500.000000, "Game Center", "");
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: respowning?

Postby hunter84 » Fri Nov 11, 2011 1:16 am

ok i fixed that but when i go into game mode and die he doesn't respawn
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: respowning?

Postby skydereign » Fri Nov 11, 2011 1:25 am

Oh, I didn't look really at the code RipperR7420 gave, just how to fix it. The code itself is a bit off, since it spawn the actor relative to the view, then moves the view. So, RipperR7420 assumed that you want the player to respawn at the beginning of the level. So, in the suggested case (240, 160). That means that you'd move the view back to (0, 0).
Code: Select all
if(RESPAWN==1)
{
    CreateActor("Player", "PlayerStandRight", "(none)", "(none)", 240, 160, true);
    RESPAWN=0;
    view.x=0;
    view.y=0;
}
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: respowning?

Postby hunter84 » Fri Nov 11, 2011 1:38 am

no didn't work but could it be that i dont have a checkpoint? all i want is for the player to respawn when he dies
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: respowning?

Postby skydereign » Fri Nov 11, 2011 4:06 am

Yeah, this isn't a method I'd suggest for checkpoints and respawning in general, but I was just using what RipperR7420 was using. My guess is that you are never setting RESPAWN equal to 1. When the player dies, so in its DestroyActor event, you'll need to set RESPAWN to 1, if you want the view to create the player again.
Player -> Destroy Actor -> Script Editor
Code: Select all
RESPAWN=1;
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: respowning?

Postby RippeR7420 » Fri Nov 11, 2011 3:09 pm

That code is also meant for iphone(rotated left) resolution.. 480x 320y.
and thanks Sky for fixin my mistake :)

If you post your code, or upload a .ged, it would make it a lot easier for
us to help ya :D
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: respowning?

Postby hunter84 » Fri Nov 11, 2011 4:39 pm

okay but its basic right now im just trying to get all the controls ready so here it is

practice.ged;.ged
Attachments
practice.ged;.ged
(8.05 KiB) Downloaded 89 times
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: respowning?

Postby RippeR7420 » Sat Nov 12, 2011 5:20 pm

I need the data file in order to view your animations...
You should upload a .zip or a .rar file with all of your files :D
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score

Re: respowning?

Postby hunter84 » Sat Nov 12, 2011 8:05 pm

okay what should i use to zip the folder
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: respowning?

Postby RippeR7420 » Sat Nov 12, 2011 8:13 pm

I Would use Either Winzip, or Winrar. :)
CURRENT PROJECTS:

-Olo: The Sword Shaman http://game-editor.com/forum/viewtopic.php?f=4&t=12919

-The Wrath of Blob: (On the back burner)

-StickMcGee - Blast to the Future http://game-editor.com/forum/viewtopic.php?f=4&t=13660
User avatar
RippeR7420
 
Posts: 391
Joined: Mon Apr 27, 2009 4:16 pm
Location: Salt Lake City, Utah.
Score: 23 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest