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
Certain Entities are unscriptable?
gbstrcl Offline
Junior Member

Posts: 3
Threads: 2
Joined: Apr 2020
Reputation: 0
#1
Certain Entities are unscriptable?

I do an interact callback between an in-game area script and a function that sets invisible the mesh of a book pile. thats what its supposed to do at least. But nothing happens, and there are no errors telling me what I could've done wrong. Ive quadruple checked all names and everything is consistent. Just the entity doesn't go anywhere, dissapear, or anything. Only the sound plays.

void OnStart()
{  
    SetEntityPlayerInteractCallback("ScriptInteract", "OnInteract", true);
}

void OnInteract(string &in asEntity)
{
    PlaySoundAtEntity("", "BookSlide.snt", "Player", 0, false);
    SetEntityPos("BookPile1", 3000, 3000, 3000);

//set entity pos was after I tried set mesh invisble and deactivate entity. Still nothing.



}


Attached Files
.jpg   Editor.JPG (Size: 107.96 KB / Downloads: 197)
(This post was last modified: 04-09-2020, 02:03 AM by gbstrcl.)
04-09-2020, 01:58 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Certain Entities are unscriptable?

Certain entities cannot be modified like this unfortunately. If you open them in the Model Editor, you can check their type under Settings > User Defined Variables. If this is set to StaticProp, it will be limited. You can fix it by changing it to Object (Static) instead, but you must save it as a custom entity and use that instead.

If you just want to make it disappear, you can try SetPropActiveAndFade. I think it works on StaticProp type entities, unless I'm misremembering.

04-09-2020, 12:01 PM
Find




Users browsing this thread: 1 Guest(s)