Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IT WORKS! yay
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#1
IT WORKS! yay

Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
(This post was last modified: 04-11-2012, 04:01 PM by jessehmusic.)
04-11-2012, 02:29 PM
Website Find
Cranky Old Man Offline
Posting Freak

Posts: 986
Threads: 20
Joined: Apr 2012
Reputation: 38
#2
RE: Player Respawn on other map

(04-11-2012, 02:29 PM)jessehmusic Wrote: Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?
This question is probably answered in these forums once every week. You can also check out how Frictional Games did it in the chancel/prison map.


Noob scripting tutorial: From Noob to Pro

04-11-2012, 02:37 PM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#3
RE: Player Respawn on other map

(04-11-2012, 02:37 PM)Cranky Old Man Wrote:
(04-11-2012, 02:29 PM)jessehmusic Wrote: Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?
This question is probably answered in these forums once every week. You can also check out how Frictional Games did it in the chancel/prison map.
they have to hard script i dont understand them :S

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-11-2012, 02:37 PM
Website Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#4
RE: Player Respawn on other map

(04-11-2012, 02:29 PM)jessehmusic Wrote: Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?
.
You can set the player's health to 0 by using:
void SetPlayerHealth(float afHealth);

You can set up a checkpoint that calls a function when you die. Put in a mapchange into that function.

void CheckPoint (string& asName, string& asStartPos, string&asCallback, string& asDeathHintCat, string& asDeathHintEntry);

Sets a checkpoint at which the player will respawn in case he dies.
Callback syntax: void MyFunc(string &in asName, int alCount)
Count is 0 on the first checkpoint load!

asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file

AND

void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);

Immediatly loads another map.

asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded

I can come up with three more possible ways to script this, but using checkpoints is probably the best way.
(This post was last modified: 04-11-2012, 02:52 PM by Mackiiboy.)
04-11-2012, 02:48 PM
Website Find
Stepper321 Offline
Senior Member

Posts: 263
Threads: 26
Joined: Nov 2011
Reputation: 8
#5
RE: Player Respawn on other map

Well, it's the script you have to use.

Signature to awesome to be displayed.
04-11-2012, 02:48 PM
Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#6
RE: Player Respawn on other map

(04-11-2012, 02:48 PM)Mackiiboy Wrote:
(04-11-2012, 02:29 PM)jessehmusic Wrote: Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?
.
You can set the player's health to 0 by using:
void SetPlayerHealth(float afHealth);

You can set up a checkpoint that calls a function when you die. Put in a mapchange into that function.

void CheckPoint (string& asName, string& asStartPos, string&asCallback, string& asDeathHintCat, string& asDeathHintEntry);

Sets a checkpoint at which the player will respawn in case he dies.
Callback syntax: void MyFunc(string &in asName, int alCount)
Count is 0 on the first checkpoint load!

asName - the internal name
asStartPos - the name of the StartPos in the editor
asCallback - the function to call when the player dies/respawns
asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file

AND

void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);

Immediatly loads another map.

asMapName - the file to load
asStartPos - the name of the StartPos on the next map
asStartSound - the sound that is played when the change starts
asEndSound - the sound that is played when the new map is loaded
whats the callback i should use?

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-11-2012, 02:50 PM
Website Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#7
RE: Player Respawn on other map

(04-11-2012, 02:50 PM)jessehmusic Wrote: whats the callback i should use?
.
Callback syntax for checkpoints: void MyFunc(string &in asName, int alCount)
So you'll have to put your ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); into MyFunc.
04-11-2012, 02:54 PM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#8
RE: Player Respawn on other map

(04-11-2012, 02:54 PM)Mackiiboy Wrote:
(04-11-2012, 02:50 PM)jessehmusic Wrote: whats the callback i should use?
.
Callback syntax for checkpoints: void MyFunc(string &in asName, int alCount)
So you'll have to put your ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound); into MyFunc.
So the Changemap is the callback ? getting confused ?


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-11-2012, 02:56 PM
Website Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#9
RE: Player Respawn on other map

(04-11-2012, 02:56 PM)jessehmusic Wrote: So the Changemap is the callback ? getting confused ?
.
MyFunc or whatever you are going to call it is the callback. That function should call the ChangeMap.
.
void CheckPoint (string& asName, string& asStartPos, string&asCallback, string& asDeathHintCat, string& asDeathHintEntry);

asCallback - the function to call when the player dies/respawns

So, when you die, a function will be called, lets call it MyFunc.

That function has the callback syntax (string &in asName, int alCount)

void MyFunc(string &in asName, int alCount)
{
// Put everything here that you want to happen after death
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
}


(This post was last modified: 04-11-2012, 03:08 PM by Mackiiboy.)
04-11-2012, 03:03 PM
Website Find
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#10
RE: Player Respawn on other map

(04-11-2012, 03:03 PM)Mackiiboy Wrote:
(04-11-2012, 02:56 PM)jessehmusic Wrote: So the Changemap is the callback ? getting confused ?
.
MyFunc or whatever you are going to call it is the callback. That function should call the ChangeMap.
.
void CheckPoint (string& asName, string& asStartPos, string&asCallback, string& asDeathHintCat, string& asDeathHintEntry);

asCallback - the function to call when the player dies/respawns

So, when you die, a function will be called, lets call it MyFunc.

That function has the callback syntax (string &in asName, int alCount)

void MyFunc(string &in asName, int alCount)
{
// Put everything here that you want to happen after death
ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
}
okey i got the changemap now but Daniel start looking in the ground and he donst stop any clue?


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
04-11-2012, 03:16 PM
Website Find




Users browsing this thread: 1 Guest(s)