Magus Posted September 19, 2015 Share Posted September 19, 2015 I've a script like this, which works fine (displays a string repeatdly): IF Detect([PC]) !GlobalTimerNotExpired("mytimer","myarea") THEN RESPONSE #1 SetGlobalTimer("mytimer","myarea",TWO_ROUNDS) DisplayStringHead(LastSeenBy,~shouted~) Continue() END If I change it to IF Detect([PC]) !Heard([ANYONE],myshout) !GlobalTimerNotExpired("mytimer","myarea") THEN RESPONSE #1 SetGlobalTimer("mytimer","myarea",TWO_ROUNDS) DisplayStringHead(LastSeenBy,~shouted~) Shout(myshout) Continue() END then the block fires once and no more. I don't understand this change of behaviour. According to the complete scripting guide, a shout can only be heard within same script cycle, which means it can't affect itself (even if it could "hear" itself, which I also doubt). Link to comment
Ardanis Posted September 19, 2015 Share Posted September 19, 2015 Heard() trigger persists until a scripting block with it will evaluate true, unfortunately. As for why it hears itself... I wonder. Learn something new every day, I guess Link to comment
Magus Posted September 19, 2015 Author Share Posted September 19, 2015 So you're basically saying that the guide is wrong regarding Heard()? How about this: IF Heard([ANYONE],myshout) THEN RESPONSE #1 SetGlobalTimer("mytimer","MYAREA",TWO_ROUNDS) DisplayStringHead(Myself,~heard shout~) Continue() END IF Detect([PC]) !Heard([ANYONE],myshout) !GlobalTimerNotExpired("mytimer","myarea") THEN RESPONSE #1 SetGlobalTimer("mytimer","myarea",TWO_ROUNDS) DisplayStringHead(LastSeenBy,~shouted~) Shout(myshout) Continue() END Still, the string ("shouted") displays just once. The block with Heard() never fires at all.(And I do have myshout in shoutids) Link to comment
Avenger Posted September 20, 2015 Share Posted September 20, 2015 So you're basically saying that the guide is wrong regarding Heard()? How about this: IF Heard([ANYONE],myshout) THEN RESPONSE #1 SetGlobalTimer("mytimer","MYAREA",TWO_ROUNDS) DisplayStringHead(Myself,~heard shout~) Continue() END IF Detect([PC]) !Heard([ANYONE],myshout) !GlobalTimerNotExpired("mytimer","myarea") THEN RESPONSE #1 SetGlobalTimer("mytimer","myarea",TWO_ROUNDS) DisplayStringHead(LastSeenBy,~shouted~) Shout(myshout) Continue() END Still, the string ("shouted") displays just once. The block with Heard() never fires at all.(And I do have myshout in shoutids) You cannot hear your own shout. And you cannot tell if anyone else heard it. The HEARD trigger should be on the receiving end. Link to comment
Ardanis Posted September 20, 2015 Share Posted September 20, 2015 Guessing here, but given the perfect nature of Heard(), I think a negative of it may also be perfect, not indefinite. Link to comment
Magus Posted September 22, 2015 Author Share Posted September 22, 2015 @Avenger I'm not trying either of these things, just making sure nothing else interferes there.@Ardanis I'm not quite sure what do you mean. That !Heard cannot be "unset"? But given that the script cannot hear its own shouts, the string should be working properly, then. Anyway, I actually decided to drop this functionality from the mod, it's not crucial. (But if anyone can explain why the script works the way it does, I guess it's worth documenting). Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.