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
Script Help Credits After Death
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#11
RE: Credits After Death

Let me get one thing straight then Smile

A PlayerStartArea is an area that you start at, by f.x. a checkpoint.


You made it so when the player collides with this area, the function that makes the checkpoint calls.

What you need to understand is, that a collide function work when Entity_1 collides with Entity_2. You are not making it a checkpoint just because you put the PlayerStartArea inside it.

Instead of having this function "AddEntityCollideCallback("Player", "PlayerStartArea_2", "Checkpoint", true, 1);" inside the OnEnter, then just put "CheckPoint ("", "PlayerStartArea_2", "EndGame", "Ending", "Credits");" inside the OnEnter.


But you see: "Ending", "Credits" <-- These 2 are not correct.
If you look in the 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 fileasDeathHintEntry - the entry in the .lang file

Those 2 corresponds to

asDeathHintCat - the category of the death hint message to be used in the .lang file
asDeathHintEntry - the entry in the .lang file
Which are the category for the DeathHint and the Entry for the DeathHint, which you can find in your .lang file.


You cannot put the credits inside these files, just to make it call the credits.
This only works with the DeathHints.


Therefore you should make a deathhint category and entry inside your .lang file and put them inside the checkpoint line instead

I hope you read this, and understood it.


EDIT:

Your checkpoint syntax is also wrong.

You see this: Callback syntax: void MyFunc(string &in asName, int alCount) means that's what you should write, instead of (string &in asParent, string &in asChild, int alState) in a checkpoint function

Trying is the first step to success.
(This post was last modified: 01-19-2013, 12:11 AM by FlawlessHappiness.)
01-19-2013, 12:05 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#12
RE: Credits After Death

I think your script has quite some mistakes, AGP... here I go, this should fix it:


void OnStart ()

{ GiveItemFromFile("lantern", "lantern.ent");

SetPlayerLampOil(50.0f);



for(int i = 0;i < 3;i++)

{

GiveItemFromFile("potion_health", "potion_health.ent");

}



for(int i = 0;i < 3;i++)

{

GiveItemFromFile("potion_sanity", "potion_sanity.ent");

}



for(int i = 0;i < 2;i++)

{

GiveItemFromFile("potion_oil", "potion_oil.ent");

}



for(int i = 0;i < 1;i++)

{

GiveItemFromFile("potion_oil_large", "potion_oil_large.ent");

}



AddEntityCollideCallback("Player", "thelongfallarea", "Epicness", true, 1);


}



void OnEnter()

{

AddEntityCollideCallback("Player", "PlayerStartArea_2", "Checkpoint", true, 1);

}



void OnLeave()

{



}



void Epicness(string &in asParent, string &in asChild, int alState)

{

PlaySoundAtEntity("Epicness", "overture.snt", "thelongfallarea", 0.5, false);

}



void Checkpoint(string &in asName, int alCount)

{

CheckPoint ("", "PlayerStartArea_2", "EndGame", "Ending", "Credits");

}



void EndGame(string &in asName, int alCount)

{

StartCredits("EndGame", false, "Ending", "Credits", 5);

}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-19-2013, 12:16 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#13
RE: Credits After Death

But TheChaser, why would he collide with a PlayerStartArea to start the checkpoint, when he could start the checkpoint right when entering the map?

And why even use that PlayerStartArea for colliding? That seems very weird.

Trying is the first step to success.
01-19-2013, 12:32 AM
Find
AGP Offline
Senior Member

Posts: 448
Threads: 45
Joined: Dec 2012
Reputation: 23
#14
RE: Credits After Death

Thanks BeeKayK! You've helped out a lot! It's all fixed and now all that's left for the mod is the final pieces of wall and ceiling!

XD

01-19-2013, 01:24 AM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#15
RE: Credits After Death

(01-19-2013, 12:32 AM)BeeKayK Wrote: But TheChaser, why would he collide with a PlayerStartArea to start the checkpoint, when he could start the checkpoint right when entering the map?

And why even use that PlayerStartArea for colliding? That seems very weird.

oz tru, silly me Tongue

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-19-2013, 08:38 AM
Find




Users browsing this thread: 3 Guest(s)