Sauron The King
Junior Member
Posts: 42
Threads: 10
Joined: Oct 2011
Reputation:
0
Collapse
Hello,
I am new to scripting and I wanted to make a hallway in which a part collapses.
When you enter the Zone "Collapse_Sleepingrooms", the entity "cave_in_1" will become active, a sound of crushing stones will sound ("04_rock_break.snt") and smoke will come out of the hallway.
I have made the following:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void Onstart ()
{AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", "true", 1);}
{void SetEntityActive("cave_in_1", "true");}
I need to know what I have to do after this, because I won't get any further. If I test it now, I will get the following error:
Naamloos2.jpg (Size: 43.15 KB / Downloads: 185)
Could someone help me with this?
Kind regards,
Brian
Attached Files
Naamloos.jpg (Size: 26 KB / Downloads: 148)
10-27-2011, 11:52 PM
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
RE: Collapse
You missed a function header on the last code block.
10-27-2011, 11:58 PM
Sauron The King
Junior Member
Posts: 42
Threads: 10
Joined: Oct 2011
Reputation:
0
RE: Collapse
(10-27-2011, 11:58 PM) Your Computer Wrote: You missed a function header on the last code block.How do you add a function header and how should it look like in my scripts?
Yes I know, I am noobie at this. This is the first time working with it.
10-28-2011, 09:50 AM
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
RE: Collapse
(10-28-2011, 09:50 AM) Sauron The King Wrote: (10-27-2011, 11:58 PM) Your Computer Wrote: You missed a function header on the last code block. How do you add a function header and how should it look like in my scripts?
Yes I know, I am noobie at this. This is the first time working with it.You can't have a event happening anywhere, it has to be in a function block for it to work.
False:
void Onstart () { AddEntityCollideCallback ( "Player" , "Collapse_Sleepingrooms" , "Collidewhencollapse" , "true" , 1 );} { void SetEntityActive ( "cave_in_1" , "true" );}
True:
void Onstart () { AddEntityCollideCallback ( "Player" , "Collapse_Sleepingrooms" , "Collidewhencollapse" , "true" , 1 );} void Collidewhencollapse ( string & in asParent , string & in asChild , int alState ) { void SetEntityActive ( "cave_in_1" , "true" );}
It might be hard to read due to formatting of the text in the forums though :S
(This post was last modified: 10-28-2011, 10:15 AM by flamez3 .)
10-28-2011, 10:13 AM
devin413
Member
Posts: 175
Threads: 7
Joined: Jul 2011
Reputation:
3
RE: Collapse
Spoiler below!
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
//yehh a german one was geht
void OnEnter()
{
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
SetEntityActive("cave_in_1", true);
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}
// True never made so "True" you must make it so SetEntityActive("cave_in_1", true);
//SetEntityActive(string& asName, bool abActive); bool abActive = True or False it dont need to declaration
hope that helps you
Boris Game Studios : Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt
(This post was last modified: 10-28-2011, 02:33 PM by devin413 .)
10-28-2011, 12:12 PM
Sauron The King
Junior Member
Posts: 42
Threads: 10
Joined: Oct 2011
Reputation:
0
RE: Collapse
Thanks for the quick responses!
And actually I am a dutchman
(From holland)
After I read the posts, I made this:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void OnEnter()
{
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
}
void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{SetEntityActive("cave_in_1", "true");}
If I left "void Collidewhencollapse(string &in asParent, string &in asChild, int alState)" away, the Entity (The fallen rocks) will be there right away. So I thought that I would make the rocks appear after I entered the area by adding that sentence.
If I play my map now, I will get the following error:
"FATAL ERROR: Could not load script file 'mymaps/The_Haunted_Castle_of_Algium.hps'!
main (26,2): ERR : No matching signatures to 'SetEntityActive(string@&, string @&)'
I want the rocks to appear after I entered the area. When they appear, there must be a sound of collapsing stones.
Thanks for helping me before, but could you help me further with this?
10-28-2011, 12:53 PM
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
RE: Collapse
(10-28-2011, 12:53 PM) Sauron The King Wrote: Thanks for the quick responses!
And actually I am a dutchman (From holland)
After I read the posts, I made this:
//////////////////////////////////////////////////
// Slaapkamer Geheime doorgang
void OnStart()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
}
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void OnEnter()
{
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
}
void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{SetEntityActive("cave_in_1", "true");}
If I left "void Collidewhencollapse(string &in asParent, string &in asChild, int alState)" away, the Entity (The fallen rocks) will be there right away. So I thought that I would make the rocks appear after I entered the area by adding that sentence.
If I play my map now, I will get the following error:
"FATAL ERROR: Could not load script file 'mymaps/The_Haunted_Castle_of_Algium.hps'!
main (26,2): ERR : No matching signatures to 'SetEntityActive(string@&, string @&)'
I want the rocks to appear after I entered the area. When they appear, there must be a sound of collapsing stones.
Thanks for helping me before, but could you help me further with this?This happened because you have put "" around a bool. Bools do not need "" around them. change "true" to true
10-28-2011, 01:15 PM
devin413
Member
Posts: 175
Threads: 7
Joined: Jul 2011
Reputation:
3
RE: Collapse
Spoiler below!
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("RockSound", "explosion_rock_large.snt", "Player", 0.0F, false);
StartScreenShake(0.2, 2, 0.2, 0.2);
SetEntityActive("cave_in_1", true);
}
void OnEnter()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
//AddEntityCollide//
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
}
hope you mean that like i do it
i add a screen shake
Boris Game Studios : Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt
(This post was last modified: 10-28-2011, 02:50 PM by devin413 .)
10-28-2011, 02:44 PM
flamez3
Posting Freak
Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation:
57
RE: Collapse
(10-28-2011, 02:44 PM) devin413 Wrote:
Spoiler below!
void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("Shelf_Secret_Sleepingroom",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}
//////////////////////////////////////////////////
// Slaapkamer boel stort in
void Collidewhencollapse(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("RockSound", "explosion_rock_large.snt", "Player", 0.0F, false);
StartScreenShake(0.2, 2, 0.2, 0.2);
SetEntityActive("cave_in_1", true);
}
void OnEnter()
{
SetEntityConnectionStateChangeCallback("Lever_Sleepingroom", "func_shelf");
//AddEntityCollide//
AddEntityCollideCallback("Player", "Collapse_Sleepingrooms", "Collidewhencollapse", true, 1);
}
hope you mean that like i do it
i add a screen shakeYou have a 0.2 on your screen shake and to be safe make sure you put a f after them.
10-28-2011, 03:09 PM
devin413
Member
Posts: 175
Threads: 7
Joined: Jul 2011
Reputation:
3
RE: Collapse
rofl >.> i nerver make an f behind it
Boris Game Studios : Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt
10-28-2011, 03:16 PM