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
Script Help Dont understand this
jessehmusic Offline
Senior Member

Posts: 423
Threads: 102
Joined: Dec 2011
Reputation: 8
#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", true, 0);
AddUseItemCallback("", "Hammer", "Woodenblock", "OpenDoor", true);
}

void BreakWall(string &in asParent, string &in asChild, string &in alState)
{
SetPropHealth("mansionbase_secret_passage_1", 0);
}

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

void ScreenShake(string &in asEntity)
{
StartScreenShake(0.4, 0.4, 3, 2.6);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.0f, false);
}

void OpenDoor(string &in asItem, string &in asEntity)
{
    
SetSwingDoorLocked("WoodenBlock", false, true);
    
PlaySoundAtEntity("", "unlock_door", "WoodenBlock", 0, false);
    
RemoveItem("Hammer");
} 

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-06-2012, 08:57 PM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#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", true, 0);
AddUseItemCallback("", "Hammer", "Woodenblock", "OpenDoor", true);
}

void BreakWall(string &in asParent, string &in asChild, string &in alState)
{
SetPropHealth("mansionbase_secret_passage_1", 0);
}

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

void ScreenShake(string &in asEntity)
{
StartScreenShake(0.4, 0.4, 3, 2.6);
PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.0f, false);
}

void OpenDoor(string &in asItem, string &in asEntity)
{
    
SetSwingDoorLocked("WoodenBlock", false, true);
    
PlaySoundAtEntity("", "unlock_door", "WoodenBlock", 0, false);
    
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
jessehmusic Offline
Senior Member

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

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#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
jessehmusic Offline
Senior Member

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

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#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
jessehmusic Offline
Senior Member

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

Got the script to make it work but not to make it broken :S

http://www.moddb.com/mods/jessehmusic - Hospital of horror , WIP
01-06-2012, 09:33 PM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#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 :S
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 asItem, string &in asEntity)
{
    
SetEntityActive("Wood_21", false);
    
SetEntityActive("BrokeWood_2", true);
    
AddPropForce("BrokeWood_2", 0, 300, 100, "world");
    
//BreakJoint ("BrokeWood_2");
    
PlaySoundAtEntity("","break_wood.ogg","BrakeWoodArea_2", 0, false);
    
CreateParticleSystemAtEntity("", "ps_dust_impact_vert.ps", "BrakeWoodArea_2",false);
    
RemoveItem("Hammer");
} 


01-06-2012, 09:38 PM
Find
jessehmusic Offline
Senior Member

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

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#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




Users browsing this thread: 1 Guest(s)