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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Dont understand this
Author Message
jessehmusic Offline
Senior Member

Posts: 423
Joined: Dec 2011
Reputation: 8
Post: #11
RE: Dont understand this

Sure Smile
PHP Code: (Select All)
void OnStart()

{
SetEntityConnectionStateChangeCallback("lever""func_shelf");
SetEntityPlayerInteractCallback("Note_Test3""ScreenShake"true);
AddEntityCollideCallback("armchair_1""mansionbase_secret_passage_1""BreakWall"true0);
AddUseItemCallback("""Hammer""Woodenblock""OpenDoor"true);
}

void BreakWall(string &in asParentstring &in asChildstring &in alState)
{
SetPropHealth("mansionbase_secret_passage_1"0);
}

void func_shelf(string &in asEntityint alState)
{
    if (
alState == 1)
    {
    
SetMoveObjectState("shelf",1.0f);
    
PlaySoundAtEntity("""quest_completed.snt""shelf_move_1"0false); }
}
 
void StopTimer(string &in asTimer)
 {
  
StopPlayerLookAt();
 }
 
 
void PickNote(string &in asEntity)
{
    
StartPlayerLookAt("closet_1"5.0f5.0f"");
    
AddTimer("StopLookAt"1.5f"StopTimer");
    
PlaySoundAtEntity("""react_breath.snt""Player"0.0ffalse);
}

void ScreenShake(string &in asEntity)
{
StartScreenShake(0.40.432.6);
PlaySoundAtEntity("""explosion_rock_large.snt""Player"0.0ffalse);
}

void OpenDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("WoodenBlock"falsetrue);
    
PlaySoundAtEntity("""unlock_door""WoodenBlock"0false);
    
RemoveItem("Hammer");


http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-06-2012 08:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 43
Post: #12
RE: Dont understand this

(01-06-2012 08:57 PM)jessehmusic Wrote:  Sure Smile
PHP Code: (Select All)
void OnStart()

{
SetEntityConnectionStateChangeCallback("lever""func_shelf");
SetEntityPlayerInteractCallback("Note_Test3""ScreenShake"true);
AddEntityCollideCallback("armchair_1""mansionbase_secret_passage_1""BreakWall"true0);
AddUseItemCallback("""Hammer""Woodenblock""OpenDoor"true);
}

void BreakWall(string &in asParentstring &in asChildstring &in alState)
{
SetPropHealth("mansionbase_secret_passage_1"0);
}

void func_shelf(string &in asEntityint alState)
{
    if (
alState == 1)
    {
    
SetMoveObjectState("shelf",1.0f);
    
PlaySoundAtEntity("""quest_completed.snt""shelf_move_1"0false); }
}
 
void StopTimer(string &in asTimer)
 {
  
StopPlayerLookAt();
 }
 
 
void PickNote(string &in asEntity)
{
StartPlayerLookAt("closet_1"5.0f5.0f"");
AddTimer("StopLookAt"1.5f"StopTimer");
PlaySoundAtEntity("""react_breath.snt""Player"0.0ffalse);
}

void ScreenShake(string &in asEntity)
{
StartScreenShake(0.40.432.6);
PlaySoundAtEntity("""explosion_rock_large.snt""Player"0.0ffalse);
}

void OpenDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("WoodenBlock"falsetrue);
    
PlaySoundAtEntity("""unlock_door""WoodenBlock"0false);
    
RemoveItem("Hammer");

Try change the

AddUseItemCallback("", "Hammer", "Woodenblock", "OpenDoor", true);

to

AddUseItemCallback("", "Hammer", "wooden_boards_block", "OpenDoor", true);
Smile

01-06-2012 09:02 PM
Find all posts by this user Quote this message in a reply
jessehmusic Offline
Senior Member

Posts: 423
Joined: Dec 2011
Reputation: 8
Post: #13
RE: Dont understand this

Then i have to change the name of the block right

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-06-2012 09:03 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 43
Post: #14
RE: Dont understand this

(01-06-2012 09:03 PM)jessehmusic Wrote:  Then i have to change the name of the block right
You need to write the entity that is going to used on Smile

01-06-2012 09:04 PM
Find all posts by this user Quote this message in a reply
jessehmusic Offline
Senior Member

Posts: 423
Joined: Dec 2011
Reputation: 8
Post: #15
RE: Dont understand this

didnt work at all same prob do you gor skype then i can shere screen r maybe send map for you so you see

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-06-2012 09:11 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 43
Post: #16
RE: Dont understand this

(01-06-2012 09:11 PM)jessehmusic Wrote:  didnt work at all same prob do you gor skype then i can shere screen r maybe send map for you so you see
I'm trying get the script to work for me. I'll come back to you when im done Smile

01-06-2012 09:14 PM
Find all posts by this user Quote this message in a reply
jessehmusic Offline
Senior Member

Posts: 423
Joined: Dec 2011
Reputation: 8
Post: #17
RE: Dont understand this

Got the script to make it work but not to make it broken Confused

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-06-2012 09:33 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 43
Post: #18
RE: Dont understand this

(01-06-2012 09:33 PM)jessehmusic Wrote:  Got the script to make it work but not to make it broken Confused
I've got a perfect script for you Smile I can help you if you don't understand what you need to add etc Smile

PHP Code: (Select All)
void OnStart()
{
    
AddUseItemCallback("""Hammer""Wood_21""BrakeWood2"false);
}

void BrakeWood2(string &in asItemstring &in asEntity)
{
    
SetEntityActive("Wood_21"false);
    
SetEntityActive("BrokeWood_2"true);
    
AddPropForce("BrokeWood_2"0300100"world");
    
//BreakJoint ("BrokeWood_2");
    
PlaySoundAtEntity("","break_wood.ogg","BrakeWoodArea_2"0false);
    
CreateParticleSystemAtEntity("""ps_dust_impact_vert.ps""BrakeWoodArea_2",false);
    
RemoveItem("Hammer");


01-06-2012 09:38 PM
Find all posts by this user Quote this message in a reply
jessehmusic Offline
Senior Member

Posts: 423
Joined: Dec 2011
Reputation: 8
Post: #19
RE: Dont understand this

ty Smile btw have seen your mod it is awesome! Smile

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-06-2012 10:06 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SilentStriker Offline
Posting Freak

Posts: 950
Joined: Jul 2011
Reputation: 43
Post: #20
RE: Dont understand this

(01-06-2012 10:06 PM)jessehmusic Wrote:  ty Smile btw have seen your mod it is awesome! Smile
You got everything working? Smile Yea saw that thanks! Smile

01-06-2012 10:08 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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