Skip to content

A Question About Code

Hello!
Just curious if anyone can tell me if I interpreted this code correctly or not:
IF OR(2) !Allegiance(LastSeenBy(Myself),GOODCUTOFF) //The allegiance of the last person seen is not Goodcutoff !See([GOODCUTOFF]) //I don't see Goodcutoff Range(Player1,20) //If a player 1 is within 20 feet THEN RESPONSE #100 RandomWalkContinuous() //randomwalk everywhere END

IF OR(2) !Allegiance(LastSeenBy(Myself),GOODCUTOFF) //The allegiance of the last person seen is not Goodcutoff !See([GOODCUTOFF]) //I don't see Goodcutoff !Range(Player1,20) //If player 1 is not within 20 feet THEN RESPONSE #100 MoveToObject(Player1) //Charge for Player 1 END

Comments

  • MusignyMusigny Member Posts: 1,027
    edited August 2015
    +
    OR(2) is true if at least one of the following two statements is true.
    Generally the coders (or program viewers) use an indentation system to make the code easier to read.
    For instance:

    IF
    OR(2)
    !Allegiance(LastSeenBy(Myself),GOODCUTOFF)
    !See([GOODCUTOFF])
    !Range(Player1,20)
    THEN
    RESPONSE #100
    MoveToObject(Player1)
    END
  • JediMindTrixJediMindTrix Member Posts: 305
    edited August 2015
    So instead, is this interpretation accurate?
    IF OR(2) !Allegiance(LastSeenBy(Myself),GOODCUTOFF) //If The allegiance of the last person seen is not Goodcutoff !See([GOODCUTOFF]) //Or I don't see Goodcutoff Range(Player1,20) //And player 1 is within 20 feet THEN RESPONSE #100 RandomWalkContinuous() //Then I randomwalk everywhere END

    EDIT: I use indentations too, I pulled the original directly from an Ascension script.
    Post edited by JediMindTrix on
  • MusignyMusigny Member Posts: 1,027
    In your first examples:
    IF
    -The allegiance of the last creature I saw (creature tagged as seen) is not good OR I see no one good
    -Player1 is (not) within a 20 foot radius
    THEN
    etc...
  • lansounetlansounet Member Posts: 1,182
    If you're wondering about the uses of these 2 blocks, assuming they are in order in your 1st post, it's likely to handle blindness while not wandering too far from the fight.
  • JediMindTrixJediMindTrix Member Posts: 305
    lansounet said:

    If you're wondering about the uses of these 2 blocks, assuming they are in order in your 1st post, it's likely to handle blindness while not wandering too far from the fight.

    That is exactly what I was wondering! Thank you. At first it seemed like a bug.
Sign In or Register to comment.