05-24-2014, 11:20 AM
05-24-2014, 11:35 AM
That is not so easy to explane but here we go.
You need to have a couple of things here :
1: Open the level editor and add the "wooden_boards_block"
2: Open the level editor and add the "wooden_boards_block_broke" (at the same spot offcourse) <-- Make this UNACTIVE in the level editor
3:Add a hammer in your lvl editor and name it Hammer_1 ( i assume the hammer is an item )
4:Here is the script you should put on OnStart:
5:Here is the script you can use. ( you can change or add stuff at your own will )
If you want, you can add some particles to it.
Then simply add 1 ScriptArea called : BoardParticles in the middle of the wooden boards.
I have added the particle effect in your script already.
---
IF you want to make it like, you want to see a hammer moving...
Then it is a little\lot more complicated.
Let us know if you want it like this or with a moving visable hammer.
You need to have a couple of things here :
1: Open the level editor and add the "wooden_boards_block"
2: Open the level editor and add the "wooden_boards_block_broke" (at the same spot offcourse) <-- Make this UNACTIVE in the level editor
3:Add a hammer in your lvl editor and name it Hammer_1 ( i assume the hammer is an item )
4:Here is the script you should put on OnStart:
PHP Code:
AddUseItemCallback("", "Hammer_1", "wooden_boards_block", "ActivateBrokenBoards", false);
5:Here is the script you can use. ( you can change or add stuff at your own will )
PHP Code:
void ActivateBrokenBoards(string &in asItem, string &in asEntity)
{
SetEntityActive("wooden_boards_block", false);
SetEntityActive("wooden_boards_block_broke", true);
RemoveItem("Hammer_1");
GiveSanityBoostSmall();
CreateParticleSystemAtEntity("", "ps_cog_stone.ps", "BoardParticles", false);
CreateParticleSystemAtEntity("", "ps_break_mansionbase_wall.ps", "BoardParticles", false);
PlaySoundAtEntity("", "player_crouch", "Player", 0.0f, false);
PlaySoundAtEntity("", "break_wood.snt", "Player", 0.0f, true);
}
If you want, you can add some particles to it.
Then simply add 1 ScriptArea called : BoardParticles in the middle of the wooden boards.
I have added the particle effect in your script already.
---
IF you want to make it like, you want to see a hammer moving...
Then it is a little\lot more complicated.
Let us know if you want it like this or with a moving visable hammer.
05-24-2014, 12:20 PM
My script to that:
void OnStart
{
AddUseItemCallback("","ham1","board1","ActivateBrokenBoards",false);
}
void ActivateBrokenBoards(string &in asItem, string &in asEntity)
{
SetEntityActive("board1",false);
SetEntityActive("boardb1",true);
RemoveItem("Ham1");
GiveSanityBoostSmall();
CreateParticleSystemAtEntity("","ps_cog_stone.ps","BoardParticles", false);
CreateParticleSystemAtEntity("","ps_break_mansionbase_wall.ps","BoardParticles",false);
PlaySoundAtEntity("","player_crouch","Player",0.0f,false);
PlaySoundAtEntity("","break_wood.snt","Player",0.0f,true);
}
And i testing map: main (2,1) : Err :Expected "(".
void OnStart
{
AddUseItemCallback("","ham1","board1","ActivateBrokenBoards",false);
}
void ActivateBrokenBoards(string &in asItem, string &in asEntity)
{
SetEntityActive("board1",false);
SetEntityActive("boardb1",true);
RemoveItem("Ham1");
GiveSanityBoostSmall();
CreateParticleSystemAtEntity("","ps_cog_stone.ps","BoardParticles", false);
CreateParticleSystemAtEntity("","ps_break_mansionbase_wall.ps","BoardParticles",false);
PlaySoundAtEntity("","player_crouch","Player",0.0f,false);
PlaySoundAtEntity("","break_wood.snt","Player",0.0f,true);
}
And i testing map: main (2,1) : Err :Expected "(".
05-24-2014, 12:30 PM
(05-24-2014, 12:20 PM)MaksoPL Wrote: [ -> ]My script to that:
void OnStart
{
AddUseItemCallback("","ham1","board1","ActivateBrokenBoards",false);
}
void ActivateBrokenBoards(string &in asItem, string &in asEntity)
{
SetEntityActive("board1",false);
SetEntityActive("boardb1",true);
RemoveItem("Ham1");
GiveSanityBoostSmall();
CreateParticleSystemAtEntity("","ps_cog_stone.ps","BoardParticles", false);
CreateParticleSystemAtEntity("","ps_break_mansionbase_wall.ps","BoardParticles",false);
PlaySoundAtEntity("","player_crouch","Player",0.0f,false);
PlaySoundAtEntity("","break_wood.snt","Player",0.0f,true);
}
And i testing map: main (2,1) : Err :Expected "(".
OnStart needs brackets
PHP Code:
void OnStart()
05-24-2014, 12:33 PM
Thank you! I forgot about that.
05-24-2014, 12:41 PM
No problems! We're here to help
05-24-2014, 02:08 PM
oh yeah..
the brackets
I thought you had that up already
Did it work?
the brackets
I thought you had that up already
Did it work?