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
Activating sanity and makign a level door operate.
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#1
Activating sanity and makign a level door operate.

I think i have found the right scripting but have no idea what to do with it please write down exactly what i should do this is my script already please copy paste the scripting you do into mine so i know hwo it is set out, Thanks.

Edit: and scripting for a quest woudl also be good, i think the script is this -

void AddQuest(string& asName, string& asNameAndTextEntry);
void CompleteQuest(string& asName, string& asNameAndTextEntry);
bool QuestIsCompleted(string& asName);

My script already(please add scripting you do into it).

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
AddUseItemCallback("", "StudyKey", "castle_arched01_3", "UsedKeyOnDoor", true);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_arched01_3", false, true);
PlaySoundAtEntity("", "unlock_door", "castle_arched01_3", 0, false);
RemoveItem("StudyKey");
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
10-04-2010, 10:11 AM
Find
Equil Offline
Member

Posts: 94
Threads: 8
Joined: Sep 2010
Reputation: 0
#2
RE: Activating sanity and makign a level door operate.

What do you mean "Activating Sanity"? The functions "GiveSanityDamage" and "GiveSanityBoost" can both be used to increase/decrease sanity respectively.

Also there's a tutorial here explaining how to use level doors:
http://www.frictionalgames.com/forum/thread-4782.html
10-04-2010, 10:28 AM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#3
RE: Activating sanity and makign a level door operate.

Thanks i knew i had seen a thread before btu couldnt find it. What i mean by activiating sanity is when my script activates so that the door behind me closes and the monster finds me i want my sanity to decrease a little.
10-04-2010, 10:30 AM
Find
Equil Offline
Member

Posts: 94
Threads: 8
Joined: Sep 2010
Reputation: 0
#4
RE: Activating sanity and makign a level door operate.

Simply add
"GiveSanityDamage(<amount of damage here>, <use distort effect true/false> )"

Here's an example from your script:
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
GiveSanityDamage(1.0f, true);
SetSwingDoorClosed("castle_arched01_2", true, true);
ShowEnemyPlayerPosition("servant_grunt_1");
}
10-04-2010, 10:57 AM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#5
RE: Activating sanity and makign a level door operate.

Thanks much appreciated, everythign works except the monster cannot seem to open doors, he just stays in the one room even when ithrow stuff at the door, only way he gets me is if i open door for him or if i constantly hit door for a minute.

Any idea how to sort this out as it makes my first map overall poor.

what does 1.0 f stand for? how high can it go? i put it onto 2.0f but it doesnt seem to do too much to sanity.
10-04-2010, 12:04 PM
Find
HakePT Offline
Junior Member

Posts: 49
Threads: 1
Joined: Sep 2010
Reputation: 0
#6
RE: Activating sanity and makign a level door operate.

(10-04-2010, 12:04 PM)LoneWolf Wrote: Thanks much appreciated, everythign works except the monster cannot seem to open doors, he just stays in the one room even when ithrow stuff at the door, only way he gets me is if i open door for him or if i constantly hit door for a minute.

Any idea how to sort this out as it makes my first map overall poor.

Pathnodes. Just before a monster spawns you can set a pathnodes that the enemy will follow when he spawns. I believe if he has a door blocking his way he will destroy it.

If you have trouble making the script go to the map Guest room (the official)
there a monster spawns and destroys a door if it is open.
10-04-2010, 12:08 PM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#7
RE: Activating sanity and makign a level door operate.

Yeah but im not quite sure what to write down, i wrote down the enemy name though but thats all i know.

AddEnemyPatrolNode(servant_grunt_1, string& asNodeName, float afWaitTime, string& asAnimation);
10-04-2010, 02:52 PM
Find
Equil Offline
Member

Posts: 94
Threads: 8
Joined: Sep 2010
Reputation: 0
#8
RE: Activating sanity and makign a level door operate.

AddEnemyPatrolNode(servant_grunt_1, string& asNodeName, float afWaitTime, string& asAnimation);

Firstly, the name should be in quotations("servant_grunt_1").

asNodeName = The path node you want the grunt to move to e.g "PathNodeArea_1".

afWaitTime = How long you want the grunt to wait after reaching this node before moving onto the next, 0 auto calculates.

asAnimation = The animation to use I think, just leave this as "".

So we have:

AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
10-05-2010, 09:07 AM
Find
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#9
RE: Activating sanity and makign a level door operate.

Thanks, so i assume the enemy goes to the area 1 then back to its original starting point then back to area 1..................... etc. ?
10-05-2010, 10:15 AM
Find
Equil Offline
Member

Posts: 94
Threads: 8
Joined: Sep 2010
Reputation: 0
#10
RE: Activating sanity and makign a level door operate.

Put several of them into your onstart if you want it to walk a specific path. For example, if you wanted it to walk through pathnodes 1 through to 4, you'd have:

void OnStart()

AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");

The grunt will now walk through path nodes 1-4. I think there's another way to make them dissapear after they've walked their path, but I just tell them to walk to a node placed inside a collide area as their last path node which sets them inactive.

Answering your question though yes, I think they do just continue back and forth along their path then eventually vanish if they don't see the player, though I'm not sure of this.
10-05-2010, 10:26 AM
Find




Users browsing this thread: 2 Guest(s)