Author Topic: The dreaded YC, how best to deal with it?  (Read 2640 times)

0 Members and 1 Guest are viewing this topic.

Offline GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
The dreaded YC, how best to deal with it?
« on: April 17, 2017, 02:49:59 AM »
0
YC essentially means "nothing". The itemID and itemTYPE will both say YC at the same time. It's not a problem when, for example, you tell the script to find certain things and those things aren't there, the script will continue.

however

if you tell the script to find * and use a filter of some sort to remove unwanted results from your find "everything" command then YC is problematic. You cannot add YC to an ignore list or use YC to signal a return(if #findID = YC... does not work). So in a sub with a finditem of * how would you stop the sub from continuing on and on infinitely because it keeps finding YC(which is nothing at all) over and over?
« Last Edit: April 17, 2017, 08:26:43 AM by Gemviper »

Offline GemviperTopic starter

  • Sr. Member
  • *
  • Posts: 481
  • Activity:
    0%
  • Reputation Power: 0
  • Gemviper hides in shadows.
  • Respect: +57
  • Referrals: 2
    • View Profile
Re: The dreaded YC, how best to deal with it?
« Reply #1 on: April 17, 2017, 08:27:53 AM »
0
I just re-read that, maybe I should explain it better.

finditem * finds YC over and over if within a findindex, after it has found and ignored everything else, but cannot be ignored too and so a sub to find and ignore "everything" cannot ignore YC, or "nothing", at the end. I'm just curious as to how others deal with YC, not that many would ever search for *.

it seems that...

- YC cannot be added to an ignore list
- YC cannot be used as a condition such as "if #itemID = YC" or "#itemTYPE = YC", they are ignored
- YC is nothing, but within a findindex it is being detected via finditem * and repeats, and so never ends.
« Last Edit: April 17, 2017, 08:30:53 AM by Gemviper »

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: The dreaded YC, how best to deal with it?
« Reply #2 on: April 17, 2017, 02:11:09 PM »
0
You should never be seeing YC within the #Findindex Range of 1 to #Findcnt

If #Findcnt = 0
#FIndID will be YC

if #Findindex > #FIndcnt
#Findid will be YC

This is why when you are indexing through things you always want to make sure there are things to index through

Finditem %Crap G_2
if #FIndcnt > 0
{
for #Findindex 1 #FIndcnt
{
Gosub Fling_Poo
}
}
Halt
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Tags: