Frictional Games Forum (read-only)

Full Version: IT WORKS! yay
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello i wonder how i make my daniel to die and later wake up on another map ?? any clue?
(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.

(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
(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.
Well, it's the script you have to use.
(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?
(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)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 ?

(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);
}


(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?

Pages: 1 2