Aller au contenu

Photo

how to: detect failed attemp to open a door


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Calgacus

Calgacus
  • Members
  • 122 messages
Hi, I tried OnFailtoOpen event but it doens't fire, I guess it only fires when the player attempts to use Open Lock skill on a  locked object.
So, How do I detect when the player fails to open a door thats locked without trying to use the open lock skil.
Thanks

PS: Maybe a custom trap script?  it fires every time someone attepts to open the door - but I want the behavior only when the door fails to open - I guess I could but  another variable on the door..

PPS: But would that force an innapropriate trap message to display?

Modifié par Calgacus, 22 septembre 2010 - 04:24 .


#2
GhostOfGod

GhostOfGod
  • Members
  • 863 messages
You do use the "OnFailToOpen" event. How are you scripting it? Are you using GetClickingObject(); to define the player?

#3
Calgacus

Calgacus
  • Members
  • 122 messages
i used getlastopenedby - not sure why, let me try the other...

#4
Calgacus

Calgacus
  • Members
  • 122 messages
No luck,  seems the code just does not run as I get no end turn message, here the OnFailToOpen script:


#include "laby_vars"
#include "laby_turn_funcs"


void main(){
oPC = GetPlaceableLastClickedBy();
oArea = GetArea(oPC);
FloatingTextStringOnCreature("Your turn is over.", oPC, FALSE);
endTurn();
SoundObjectPlay(GetObjectByTag(GetLocalString(oArea, snd_HITWALL)));
DragonsTurn();
}

Modifié par Calgacus, 22 septembre 2010 - 04:38 .


#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Calgacus wrote...

 oPC = GetPlaceableLastClickedBy();
 }


Your  problem is you are useing the placable functions for the door events. A door is not a placeable.

try useing:

object oPC = GetClickingObject();

#6
Calgacus

Calgacus
  • Members
  • 122 messages
Thanks, i'll try it out.

#7
GhostOfGod

GhostOfGod
  • Members
  • 863 messages

GhostOfGod wrote...

Are you using GetClickingObject(); to define the player?


Deja vu? :whistle:

Modifié par GhostOfGod, 23 septembre 2010 - 03:31 .