Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


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

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#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
teddan50 Offline
Junior Member

Posts: 15
Threads: 2
Joined: Dec 2011
Reputation: 0
#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 :S
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
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#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
Website Find
CorinthianMerchant Offline
Posting Freak

Posts: 2,876
Threads: 84
Joined: Nov 2011
Reputation: 131
#94
RE: Scripts Recollection

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

Still hasn't gotten over the loss of wubwub...
01-12-2012, 05:26 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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
CorinthianMerchant Offline
Posting Freak

Posts: 2,876
Threads: 84
Joined: Nov 2011
Reputation: 131
#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!

Still hasn't gotten over the loss of wubwub...
01-15-2012, 01:09 PM
Find
Loveridge Offline
Junior Member

Posts: 21
Threads: 8
Joined: Nov 2011
Reputation: 0
#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
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#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
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#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
CorinthianMerchant Offline
Posting Freak

Posts: 2,876
Threads: 84
Joined: Nov 2011
Reputation: 131
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.



Still hasn't gotten over the loss of wubwub...
(This post was last modified: 01-20-2012, 05:15 PM by CorinthianMerchant.)
01-20-2012, 05:15 PM
Find




Users browsing this thread: 1 Guest(s)