Jump to content

Strange shout behaviour


Magus

Recommended Posts

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

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

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

@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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...