Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Thread Closed 
 
Thread Rating:
  • 16 Vote(s) - 4.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripts Recollection
Author Message
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #91
RE: Scripts Recollection

In math, as they say, combine like terms.

So what is in the void OnStart() combines with what is in the other one.

It should look like this:

void OnStart()
{
     AddUseItemCallback("", "torture_1", "castle_1", "KeyOnDoor1", true);
     AddUseItemCallback("", "tomb", "mansion_1", "KeyOnDoor2", true);
     AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterFunc1", true, 1);
}

void KeyOnDoor1(string &in asItem, string &in asEntity)
{
     SetSwingDoorLocked("castle_1", false, true);
     PlaySoundAtEntity("", "unlock_door.snt", "castle_1", 0.0f, true);
     RemoveItem("torture_1");
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
     SetSwingDoorLocked("mansion_1", false, true);
     PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0.0f, true);
     RemoveItem("tomb");
}

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

void OnLeave()
{
}

(This post was last modified: 11-09-2011 02:01 AM by Kyle.)
11-09-2011 02:00 AM
Find all posts by this user
teddan50 Offline
Junior Member

Posts: 15
Joined: Dec 2011
Reputation: 0
Post: #92
RE: Scripts Recollection

(04-18-2011 05:42 PM)nkmol Wrote:  i'm trying to use the moveable_book, but it seems it doesn't work as a normal lever Confused
i used this script :
void OnStart()
{
SetEntityConnectionStateChangeCallback("book_moveable_1", "BookMoved");
}

void BookMoved(string &in EntityName, int alState)
{
AddDebugMessage("book_moveable_1" + "'s current state: " + alState, false);

if(alState == 1)
{
SetPropHealth("default_broken01_1", 0);
StartScreenShake(0.07f, 0.3f, 1, 1);
SetLeverStuckState("book_moveable_1", 1, true);
}
}


even the DebugMessage doesn't work.
I don't get any error, think it has to do whith the OnStart line though. But i can't find a other script that works. And yes, i putted the callback in the level editor Big Grin




I did it like this:

void OnStart()
{
AddEntityCollideCallback("booklever_1", "ScriptArea_1", "Dooropening", true, 1);

}

void Dooropening(string &in asParent , string &in asChild , int alState)
{
SetSwingDoorLocked("mansion_1", false, false);
}



Probably not the correct method, but it worked for me. You just have to make sure that the book enters the scriptarea when you pull it out.
12-12-2011 10:40 PM
Find all posts by this user
jessehmusic Offline
Senior Member

Posts: 423
Joined: Dec 2011
Reputation: 8
Post: #93
RE: Scripts Recollection

what is that i gonna set in lang file to make the key have another name...

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
12-23-2011 03:04 PM
Visit this user's website Find all posts by this user
CorinthianMerchant Offline
Posting Freak

Posts: 2,833
Joined: Nov 2011
Reputation: 129
Post: #94
RE: Scripts Recollection

What is the minimum script necessary to make a map work?

“The more you know, the more you know you don't know.”

― Aristotle
01-12-2012 05:26 PM
Find all posts by this user
Elven Offline
Posting Freak

Posts: 859
Joined: Aug 2011
Reputation: 26
Post: #95
RE: Scripts Recollection

(01-12-2012 05:26 PM)CorinthianMerchant Wrote:  What is the minimum script necessary to make a map work?
none

The Interrogation
Chapter 1

My tutorials
01-13-2012 10:19 PM
Find all posts by this user
CorinthianMerchant Offline
Posting Freak

Posts: 2,833
Joined: Nov 2011
Reputation: 129
Post: #96
RE: Scripts Recollection

(01-13-2012 10:19 PM)Elven Wrote:  
(01-12-2012 05:26 PM)CorinthianMerchant Wrote:  What is the minimum script necessary to make a map work?

none


Thanks!

“The more you know, the more you know you don't know.”

― Aristotle
01-15-2012 01:09 PM
Find all posts by this user
Loveridge Offline
Junior Member

Posts: 21
Joined: Nov 2011
Reputation: 0
Post: #97
RE: Scripts Recollection

I need some help... This script doesnt work.. It says its missing "'" or ";".. Im trying to make it so when you step somewhere you gasp and sanity goes. then you turn round and there is bodies.. Please Help


////////////////////////////
// Run when entering map
void OnStart()

void Collide "ScriptArea_1"(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("scare_wall_stomp", "Player", 0, false);
GiveSanityDamage(50, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
01-19-2012 08:21 PM
Find all posts by this user
Khyrpa Offline
Senior Member

Posts: 638
Joined: Apr 2011
Reputation: 24
Post: #98
RE: Scripts Recollection

////////////////////////////
// Run when entering map
void OnStart()
{
}
void Collide "ScriptArea_1"(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("scare_wall_stomp", "Player", 0, false);
GiveSanityDamage(50, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}




always brackets after void's. This wont still work because you have anything that sets the void Collide to motion. thers lots of wrong, try to go through some tutorials

01-19-2012 08:35 PM
Find all posts by this user
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #99
RE: Scripts Recollection

I'll just nudge you in the right direction : )


Quote:////////////////////////////
// Run when entering map
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Gasp", true, 1);
}

void Gasp(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("scare_wall_stomp", "Player", 0, false);
GiveSanityDamage(50, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

01-20-2012 02:32 AM
Find all posts by this user
CorinthianMerchant Offline
Posting Freak

Posts: 2,833
Joined: Nov 2011
Reputation: 129
Post: #100
RE: Scripts Recollection

Help, please! How do I script this; you walk through a script area without anything happening, but when you enter it with a certain key, a monster will spawn.

================================================================================​=====

Lamps will extinguish when you pick up a key.

================================================================================​=====

When using objects A and B on object C lamps will go out and you die like in the portal ending and you will be transported into a dark tunnel similar to the original one but with a billboard instead of the original light.

================================================================================​===

When putting entity D inside script area 1 and using object E on object C a sound will play and particles will be deactivated and a lever will appear.

“The more you know, the more you know you don't know.”

― Aristotle
(This post was last modified: 01-20-2012 05:15 PM by CorinthianMerchant.)
01-20-2012 05:15 PM
Find all posts by this user
Thread Closed 




User(s) browsing this thread: 1 Guest(s)