Frictional Games Forum (read-only)

Full Version: Few questions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
1. How to make scripts work again after death? For example, if monsters show up in certain area and they kill you, in most of the custom stories I play'd happened the thing that when they killed you and you respawned, they no more appeared in that area. Is it somehow possible to make them appear even after you die?

2. How to make credits show up when you die? By this I basically mean that when you're in certain area and monsters appears and kills you, credits start and the Custom Story ends. Is that possible?

3. How to add custom entities? Now I would probably need this one mostly, how do you add custom entities to your Custom Story? I know something about creating new folder called "entities" in your Custom Story folder, but how to make them work and all that?

4. Is it possible to have custom lantern models like flashlight in Custom Story? Do you need to do Full Conversion, or it can somehow be done even without it? I tried to search for this one, no luck.

5. Adding massage to locked door doesn't work for me. I have went through some threads on this forum and tried few of their scripts(of course I edited door name and that stuff), however, no luck of making it work, game started, however, massage didn't appear. Could someone please send me a script of it? (Main command + void, without these "as strings", "float" and such things, because I honestly have no idea what it means....)


Sorry if some of these questions were already questioned and answered on forums or so. Thanks a lot for any help.
1. there is a way, I fixed it for someone. Will put a link to that thread.
2. I'm not sure if this is possible, I really don't know.
3. Nothing else, just put them in the the 'entities' folder inside your custom story folder and you're good to go.
4. You'll need a FC for this. You have to tell the game where to find the lantern, and you can't change that in just a CS.
5. Just use a function for the door like this:
Code:
void OnStart()
{
SetEntityPlayerInteractCallback("door", "function", false);
}

void function(string &in asEntity)
{
if(GetSwingDoorLocked("door")===true)
{
SetMessage("Category", "Entry", 1 -Or any other time you want-);
}
else
{
do anything else if the door is unlocked
}
}

That should do it
2.
Easy-peasy

What you do it to create a Checkpoint that makes you spawn in a pitchblack room.
With the checkpoint, comes a callback, which you can put any script line into... Just put the Credits script into there.

????

Profit!
1.
If you just add a checkpoint:

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


Then when you die and go back to it, just make the areas / enemies etc. active by using the code:
Code:
SetEntityActive(string& asName, bool abActive);


P.S. Remember to untick the box which reads 'Active' so that they aren't already activated.
1) It's easy.
PHP Code:
AddEntityCollideCallback("Player""ScriptAreaName""PlayerCollideNoDelete"false1); 
The first and last true was changed to false. This is because the boolean function determines whether the callback shall be deleted when first time colliding or not.
(04-28-2013, 02:34 AM)JustAnotherPlayer Wrote: [ -> ]1) It's easy.
PHP Code:
AddEntityCollideCallback("Player""ScriptAreaName""PlayerCollideNoDelete"false1); 
The first and last true was changed to false. This is because the boolean function determines whether the callback shall be deleted when first time colliding or not.

So, basically, if I change the "true" thing in my script in my .hps file, the script will be going on over and over again? Like, the script activates, I die, go through script area, it again activates, I once more die, once more go through the area and it again activates and over and over again?
(04-28-2013, 03:18 AM)Essen Wrote: [ -> ]
(04-28-2013, 02:34 AM)JustAnotherPlayer Wrote: [ -> ]1) It's easy.
PHP Code:
AddEntityCollideCallback("Player""ScriptAreaName""PlayerCollideNoDelete"false1); 
The first and last true was changed to false. This is because the boolean function determines whether the callback shall be deleted when first time colliding or not.

So, basically, if I change the "true" thing in my script in my .hps file, the script will be going on over and over again? Like, the script activates, I die, go through script area, it again activates, I once more die, once more go through the area and it again activates and over and over again?
Yep. But after colliding it, you can activate it again.
(04-28-2013, 03:29 AM)JustAnotherPlayer Wrote: [ -> ]
(04-28-2013, 03:18 AM)Essen Wrote: [ -> ]
(04-28-2013, 02:34 AM)JustAnotherPlayer Wrote: [ -> ]1) It's easy.
PHP Code:
AddEntityCollideCallback("Player""ScriptAreaName""PlayerCollideNoDelete"false1); 
The first and last true was changed to false. This is because the boolean function determines whether the callback shall be deleted when first time colliding or not.

So, basically, if I change the "true" thing in my script in my .hps file, the script will be going on over and over again? Like, the script activates, I die, go through script area, it again activates, I once more die, once more go through the area and it again activates and over and over again?
Yep. But after colliding it, you can activate it again.

A possible fix is to re-add the callback elsewhere. Perhaps the checkpoint callback?
(04-27-2013, 04:39 PM)Essen Wrote: [ -> ]1. How to make scripts work again after death? For example, if monsters show up in certain area and they kill you, in most of the custom stories I play'd happened the thing that when they killed you and you respawned, they no more appeared in that area. Is it somehow possible to make them appear even after you die?

2. How to make credits show up when you die? By this I basically mean that when you're in certain area and monsters appears and kills you, credits start and the Custom Story ends. Is that possible?

3. How to add custom entities? Now I would probably need this one mostly, how do you add custom entities to your Custom Story? I know something about creating new folder called "entities" in your Custom Story folder, but how to make them work and all that?

4. Is it possible to have custom lantern models like flashlight in Custom Story? Do you need to do Full Conversion, or it can somehow be done even without it? I tried to search for this one, no luck.

5. Adding massage to locked door doesn't work for me. I have went through some threads on this forum and tried few of their scripts(of course I edited door name and that stuff), however, no luck of making it work, game started, however, massage didn't appear. Could someone please send me a script of it? (Main command + void, without these "as strings", "float" and such things, because I honestly have no idea what it means....)


Sorry if some of these questions were already questioned and answered on forums or so. Thanks a lot for any help.

Everything is quite easy:

1:

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptMonster", "Spawnbitch", false, 1);
}

void Spawnbitch (string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Bitch", true);
}

2:

void OnStart()
{
AddEntityCollideCallback("Player", "CheckArea", "Chepoint", true, 1);
}

void Chepoint (string &in asParent, string &in asChild, int alState)
{
CheckPoint (“FirstCheckpoint”, “PlayerStartArea_1”, “Happening”, “DeathCategory”, “Deathtext”);
}

void Happening(string &in asName, int alCount)
{
StartCredits("music.ogg", false, "TextCategory", "TextEntry", 500); ///500 is the length of the credits, dunno how to apply them though
}

3:

Simply open model Editor, make your entity out of something, and save it like:

entities/Myentities/Custimentity

Once there, put the model and texture used, and save the .ent.

4:

It's not possible to do that without overwriting the original file, so if you want to do that, make a Full Conversion (some people are just mind-challenged and don't know how to backup things)

5:

To make a message, simply:

void OnStart()
{
SetMessage("Messages", "Message_1", 2); /// it will set the message two seconds
}

Take note: You need a .lang file for anything related to language (Messages, hints, etc.)

Messages is the category, and the Message_1 the entry. Put them like this:

<CATEGORY Name="Messages">
<Entry Name="Message_1">I'm a message and I worked</Entry>
</CATEGORY>

I hope that solved all of your problems Wink
Thanks a lot for every reply, guys, I will try it all out soon. Smile
Pages: 1 2 3 4