SRL Archive - Bugs

TileOnMS + TNPC.HpRatio + GroundItems


kitchenrange

2011-01-23 10:36:33

I've been trying to use these things in fighter scripts, but every time I turn around there is a problem. When I have an array of NPCS, some are obviously on the screen and I go through them, if I put

if TileOnMS(NPC, 0) = False then Exit; or
if Not(TileOnMS(NPC,0)) then Exit; it results in the procedure getting exited
everytime.

I have a WaitForFight function that works pretty flawlessly, but I changed to to receive an NPC in its arguments. When I added:

if NPC.HpRatio = 0 then Exit; the function immediately gets exited regardless of the NPC's health.

I've still been using GroundItems but with a few problems. It only returns the first two or three items found on any given tile. This is using GetItemsNear. It is extremely frustrating to develop scripts with these problems.

My problem with Text.Simba I dont believe has been resolved. I havent ran any overnight because of these other problems.

Narcle

2011-01-23 10:58:31

Instead of exiting the function why don't you 'continue'?

kitchenrange

2011-01-23 11:09:48

I'm not sure what function you are referring to. If it is my WaitForFight function, there would be no reason to continue, I definitely want to exit. If you are talking about My ClickMonster function which is the other one, I still want to exit, the array is getting run through in another function: AttackMonster. AttackMonster finds the first available monster that is free and passes it as an argument into ClickMonster. ClickMonster updates the NPC info and if anything changes, such as the NPC walking off screen, I would like it to exit the function or whatever else I want it to do it doesnt matter.

It doesnt matter what it is that I want to do when the conditions are met, the problem is that it is reading the conditions as met when they are clearly not.

**BANNED The Man

2011-01-23 11:18:01

I think TileToMS is broken or something?
Because my Ess Miner WILL NOT detect that it is near a certain tile.
Or Tiling overall?

kitchenrange

2011-01-23 11:24:36

It has something to do with TileOnMS I believe. TileToMS and TileToMSEx seem to be working beautifully.

mormonman

2011-01-23 13:46:22

In order for HPRatio to return the correct value, the NPC has to be in a fight with the HP bar above their head. So after you click the NPC wait until you are in a fight with it and then call HPRatio, or better yet use Interacting.

kitchenrange

2011-01-23 14:29:05

From: mormonman
In order for HPRatio to return the correct value, the NPC has to be in a fight with the HP bar above their head. So after you click the NPC wait until you are in a fight with it and then call HPRatio, or better yet use Interacting.


Ok I will try it that way, although that seems odd that The HPRatio is 0 unless it is in a fight.

Any comments on the other problem?

E: HPRatio returns 0 no matter what I do.

kitchenrange

2011-01-24 10:43:51

Is there anyone I can pm this thread link to to speed up the working on it. It doesnt seem that many of these problems are high priority or that anyone is interested in working on it.

mormonman

2011-01-24 10:57:10

We are working on the text.simba errors. I have never heard of the grounditems problem before, can you give some sort of debug with a picture?

kitchenrange

2011-01-24 11:05:37

Oh I see, I was beginning to think the problems were being ignored. I will work to get you a debug picture when I get home. If you want to try yourself. Kill a cow, stand next to it and use get items near. Writeln every item Id it finds, and you will see that it stops after the 2nd (usually) item in the stack.