Author Topic: OR(#) - how many conditions it can process?  (Read 4322 times)

Domi

  • Guest
OR(#) - how many conditions it can process?
« on: April 14, 2004, 06:14:02 AM »
Not sure if Techs and Tuts allows the fre-style questions, but here it goes:

How many conditions OR(#) can process?

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: OR(#) - how many conditions it can process?
« Reply #1 on: April 14, 2004, 09:57:43 AM »
The answer to the first question is "yes" (although you missed by one forum :) )

The answer to the second is "not sure." Sim's scripting guide doesn't seem to mention a limit.

One cheap way to determine a "safe" limit would be to load up NI and start searching on OR(30), OR(31), OR(32) etc. and when you run out, you know that Bioware, at least, never went any higher. :)
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: OR(#) - how many conditions it can process?
« Reply #2 on: April 14, 2004, 01:45:18 PM »
Offhand, I see that Viconia.bcs has an OR(38), plus 3 other lines of trigger, so that's 42 total lines of trigger that they seem to think the engine can handle.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

guest

  • Guest
Re: OR(#) - how many conditions it can process?
« Reply #3 on: April 14, 2004, 01:53:12 PM »
I have once handled with an OR(61), so I am sure if there is a limit, it is above 100.

-Galactygon

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: OR(#) - how many conditions it can process?
« Reply #4 on: April 14, 2004, 04:46:41 PM »
Heck, I've got an OR(269) in Ashes of Embers and it works. :)

Edit: And two other non-OR() triggers, for a total of 271.  If there is some sort of bit or hex related limit, one would imagine that it'd be either 255, which appears not to be the case, so the next step up is 65535.  That's quite a script!
« Last Edit: April 14, 2004, 04:48:33 PM by Ghreyfain »
Earn Money Sleeping.

Offline MagusWizardo

  • Planewalker
  • *****
  • Posts: 40
Re: OR(#) - how many conditions it can process?
« Reply #5 on: April 14, 2004, 05:04:59 PM »
Ghrey, it'd actually be 65536 - 65535 is the highest value stored in two bytes, if you count from 0 (like computers do). 

Offline chaz58

  • Meh.
  • Planewalker
  • *****
  • Posts: 67
  • Windows XP f*cking sucks
Re: OR(#) - how many conditions it can process?
« Reply #6 on: April 14, 2004, 06:00:38 PM »
Wow, good job you corrected him, i was afraid i might not have been able to use OR(65536) in my script like i was going to...  :P

Domi

  • Guest
Re: OR(#) - how many conditions it can process?
« Reply #7 on: April 14, 2004, 07:59:06 PM »
Oh, thank you... So, OR is pretty much limitless! Viva...erm...something!

P.S. Nope, I did not aim for Tuts, since in the olden time it was not a question-ground  :D

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: OR(#) - how many conditions it can process?
« Reply #8 on: April 14, 2004, 08:08:00 PM »
Ghrey, it'd actually be 65536 - 65535 is the highest value stored in two bytes, if you count from 0 (like computers do). 

Oh yes, I'd forgotten that OR(0) probably doesn't work. :)  So yeah, 256, or 65536.  Whatever. :)
Earn Money Sleeping.

Offline rreinier

  • Planewalker
  • *****
  • Posts: 297
  • Gender: Male
Re: OR(#) - how many conditions it can process?
« Reply #9 on: May 19, 2004, 07:58:24 AM »
Well, it can't be 256, since you have a working OR(269), so I'd say 65536 would be the maximum, if there is any...

Or 16777216, of course ;)

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: OR(#) - how many conditions it can process?
« Reply #10 on: May 19, 2004, 01:05:07 PM »
I am attempting to understand the usage of OR(#) but I find it confusing, especially when used as shown where it appears there is nesting.  Can someone explain which actions belong to the "OR" blocks which I've colored?

I think the commands shown below are not in the OR block, am I correct?

Quote
IF ~Global("ViconiaRomanceActive","GLOBAL",1)
IsValidForPartyDialog("Viconia")~ THEN EXTERN ~BVICONI~ 567

Thanks.

IF WEIGHT #15 /* Triggers after states #: 510 even though they appear after this state */
~Global("JaheiraMatch","GLOBAL",1)
Global("LoveTalk","LOCALS",22)
!StateCheck(Player1,STATE_SLEEPING)~ THEN BEGIN 188 // from:
  SAY #21151 /* ~I... I worry sometimes...~ [JAHEIR83] */
  IF ~OR(2)
!Global("ViconiaRomanceActive","GLOBAL",1)
!IsValidForPartyDialog("Viconia")
OR(2)
!Global("AerieRomanceActive","GLOBAL",1)
!IsValidForPartyDialog("Aerie")~ THEN GOTO 189
  IF ~Global("ViconiaRomanceActive","GLOBAL",1)
IsValidForPartyDialog("Viconia")~ THEN EXTERN ~BVICONI~ 567
  IF ~OR(2)
!Global("ViconiaRomanceActive","GLOBAL",1)
!IsValidForPartyDialog("Viconia")
Global("AerieRomanceActive","GLOBAL",1)
IsValidForPartyDialog("Aerie")~ THEN EXTERN ~BAERIE~ 446
END

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: OR(#) - how many conditions it can process?
« Reply #11 on: May 19, 2004, 02:07:29 PM »
You would read that as: If ViconiaRomanceActive isn't 1 or Viconia isn't available for party dialog AND AerieRomanceActive isn't 1 or Aerie isn't available for party dialog THEN goto 189

IF ~Global("ViconiaRomanceActive","GLOBAL",1)
IsValidForPartyDialog("Viconia")~ THEN EXTERN ~BVICONI~ 567  is not part of any OR() block.

OR(#) only looks at the first # of triggers following the OR().  So if you had OR(2) Trigger1 Trigger2 Trigger3 Trigger4 you would read it as Trigger1 OR Trigger2 AND Trigger3 AND Trigger4
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: OR(#) - how many conditions it can process?
« Reply #12 on: May 19, 2004, 02:58:21 PM »
Thanks - then am I to understand that the OR block I've colored blue is part of the two condition OR block (red)?  And that the next set (uncolored) is an entirely new OR condition?

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: OR(#) - how many conditions it can process?
« Reply #13 on: May 19, 2004, 03:16:18 PM »
IF WEIGHT #15 /* Triggers after states #: 510 even though they appear after this state */
~Global("JaheiraMatch","GLOBAL",1)
Global("LoveTalk","LOCALS",22)
!StateCheck(Player1,STATE_SLEEPING)~ THEN BEGIN 188 // from:
  SAY #21151 /* ~I... I worry sometimes...~ [JAHEIR83] */
1  IF ~OR(2) !Global("ViconiaRomanceActive","GLOBAL",1) !IsValidForPartyDialog("Viconia")
          OR(2) !Global("AerieRomanceActive","GLOBAL",1) !IsValidForPartyDialog("Aerie")~ THEN GOTO 189
2  IF ~Global("ViconiaRomanceActive","GLOBAL",1) IsValidForPartyDialog("Viconia")~ THEN EXTERN ~BVICONI~ 567
3  IF ~OR(2) !Global("ViconiaRomanceActive","GLOBAL",1) !IsValidForPartyDialog("Viconia")
          Global("AerieRomanceActive","GLOBAL",1) IsValidForPartyDialog("Aerie")~ THEN EXTERN ~BAERIE~ 446
END

You have 3 transitions, each started with the IF.  1 has 2 OR statements, 2 has no OR statements and 3 has 1 OR statement.

The ones you colored blue and red are part of the first transition.  The uncolored one is part of the 3rd transition.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 832
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: OR(#) - how many conditions it can process?
« Reply #14 on: May 19, 2004, 03:19:42 PM »
All conditions in an IF statement must be true for the trigger to be true. An OR(x) block means one of the following x conditions much be true for the OR itself to be true. Stacking more than one OR in a trigger means that one item must be true from each individual OR. It may help to look at it like this (first trigger only):

Code: [Select]
OR(2)
   !Global("ViconiaRomanceActive","GLOBAL",1)
   !IsValidForPartyDialog("Viconia")
OR(2)
   !Global("AerieRomanceActive","GLOBAL",1)
   !IsValidForPartyDialog("Aerie")

So one condition must be true from both ORs for the trigger as a whole to be true.
« Last Edit: May 19, 2004, 06:13:07 PM by CamDawg »
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: OR(#) - how many conditions it can process?
« Reply #15 on: May 19, 2004, 05:25:32 PM »
Thanks all!  This has gone a long way towards clearing up the mystery of "OR"!  :D

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: