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
Help please
Sabrak Offline
Junior Member

Posts: 7
Threads: 3
Joined: Jul 2013
Reputation: 0
#1
Help please

Hello everyone i need a little help here. I am creating a secret way with closet (when player press button, the shelf will "move away"). So i created one shelf with some things (books, golden statue and some other things) and one same but not active. Later i made script
Quote:void OnStart()
{
//////////Button//////////
SetEntityPlayerInteractCallback("Button", "Secret", true);
}

//////////Secret patch//////////
void Secret(string &in asEntity)
{
SetEntityActive("shelf_high01_1", false);
SetEntityActive("book_row03_4", false);
SetEntityActive("book_row03_5", false);
SetEntityActive("book_row03_6", false);
SetEntityActive("book_row03_3", false);
SetEntityActive("book_row03_2", false);
SetEntityActive("book_row03_1", false);
SetEntityActive("paperpile01_1", false);
SetEntityActive("paperpile01_2", false);
SetEntityActive("genie_bottle_1", false);
SetEntityActive("book_pile01_2", false);
SetEntityActive("book_row03_11", false);
SetEntityActive("book_row03_10", false);
SetEntityActive("arabic_statue_gold_1", false);
SetEntityActive("book_row03_7", false);
SetEntityActive("book_row03_8", false);
SetEntityActive("book_row03_9", false);
SetEntityActive("shelf_high01_2", true);
SetEntityActive("book_row03_19", true);
SetEntityActive("book_row03_23", true);
SetEntityActive("book_row03_24", true);
SetEntityActive("book_row03_20", true);
SetEntityActive("book_row03_21", true);
SetEntityActive("book_row03_22", true);
SetEntityActive("paperpile01_3", true);
SetEntityActive("paperpile01_4", true);
SetEntityActive("genie_bottle_2", true);
SetEntityActive("book_pile01_3", true);
SetEntityActive("book_row03_25", true);
SetEntityActive("book_row03_29", true);
SetEntityActive("arabic_statue_gold_2", true);
SetEntityActive("book_row03_26", true);
SetEntityActive("book_row03_27", true);
SetEntityActive("book_row03_28", true);
SetEntityActive("Billboard_76", false);
SetEntityActive("Billboard_74", false);
PlaySoundAtEntity("Mechanism1", "move_gate", "Button", 0, false);
AddTimer("", 5.0f, "Stop");
}

//////////Stop button sound//////////
void Stop(string &in asTimer)
{
StopSound("Mechanism1", 2.0f);
}

void OnEnter()
{

}

void OnLeave()
{

}
but only entity that changes is golden statue and "genie bottle Big Grin". Where i made mistake? (Sorry for my english xD)
(This post was last modified: 08-29-2013, 05:01 PM by Sabrak.)
08-29-2013, 04:43 PM
Find
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#2
RE: Help please

It looks like it's because all the other items, the ones that don't change, are Static objects & billboards - only Entities can be 'activated' or 'de-activated' using SetEntityActive

(This post was last modified: 08-29-2013, 04:48 PM by Adrianis.)
08-29-2013, 04:48 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#3
RE: Help please

SetEntityActive does not affect entities which are "StaticProps".

If you want to change this open the entity of your choice in the model editor, and change its "User-Defined Variables" to "Object", and save a new file.

[Image: Tv0YgQb.gif]
Image by BandyGrass
08-29-2013, 04:51 PM
Find
Sabrak Offline
Junior Member

Posts: 7
Threads: 3
Joined: Jul 2013
Reputation: 0
#4
RE: Help please

and is there any other way how to activate or de-activate static objects or billboards with script?
08-29-2013, 04:53 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#5
RE: Help please

(08-29-2013, 04:53 PM)Sabrak Wrote: and is there any other way how to activate or de-activate static objects or billboards with script?

Billboards you can attach to a light, and then turn the light off with script which in turn will render the billboards invisible as well.

As for static objects, you pretty much have to convert them into proper entities in the model editor.

[Image: Tv0YgQb.gif]
Image by BandyGrass
08-29-2013, 04:55 PM
Find
Sabrak Offline
Junior Member

Posts: 7
Threads: 3
Joined: Jul 2013
Reputation: 0
#6
RE: Help please

ok, thanks Big Grin i will now continue with my custom story Smile i was stuck at this 2 hours Big Grin
08-29-2013, 05:00 PM
Find




Users browsing this thread: 1 Guest(s)