SRL Archive - MSI Suggestions

FindObjects


Camaro'

2010-11-06 00:37:40

I have been using



if MSI_FindObjects(Monsters, MonsterIndex, ClickRight)) then

I made two objects in objects.simba

BROWN_CHICKEN
WHITE_CHICKEN

I couldn't combine these into one TPA because of the color speed modifiers are different ( something like that ;))

In my opinion, it needs to find the closest object in the array and click that one, what it does now, is it goes through the array and clicks the first it finds.

For example:


Lets just say my array is [WHITE_CHICKEN, BROWN_CHICKEN]. In the above picture it would attack the white chicken even though its farther away :(

My idea is, if you haven't gathered it by now, is that the function goes through all your objects and finds the closest one (unless its a power_skill of course :) )

Maybe needs a little updating? Or perhaps another object finding function that does this?

Thanks

Coh3n

2010-11-06 03:13:58

Okay wow I just had a huge reply for this and I accidentally clicked back on my mouse and I lost it all. :o

Basically, it will click the object it searches for first (for mining/fishing/woodcutting). This is because we have the "Priority" option. If, for example, Mith Rocks were given priority over Coal Rocks, we would want it to click the Mith even though it would be further away. The same can be done for fighting (if you're waiting for a monster to spawn, kill lower level monsters around you).

I think one of the object functions is able to click the closest object, but I'm not 100% sure about that. If not, there should be the option to. I think if we added a boolean to TScriptSetup (ClickClosest), then it will or will not click the closest object to the player.

Camaro'

2010-11-06 08:30:36

From: Coh3n
Okay wow I just had a huge reply for this and I accidentally clicked back on my mouse and I lost it all. :o

Basically, it will click the object it searches for first (for mining/fishing/woodcutting). This is because we have the "Priority" option. If, for example, Mith Rocks were given priority over Coal Rocks, we would want it to click the Mith even though it would be further away. The same can be done for fighting (if you're waiting for a monster to spawn, kill lower level monsters around you).

I think one of the object functions is able to click the closest object, but I'm not 100% sure about that. If not, there should be the option to. I think if we added a boolean to TScriptSetup (ClickClosest), then it will or will not click the closest object to the player.


If there is no priorities set it will still do the same.

Personally, I think if there are no priorities set, then it should automatically click the closest object.

NCDS

2010-11-06 11:10:29

[QUOTE=Camaro';747948]If there is no priorities set it will still do the same.

Personally, I think if there are no priorities set, then it should automatically click the closest object.[/QUOTE]

It pick's an object randomly from the Objects array if no priority is set.

Coh3n

2010-11-06 12:12:10

From: NCDS
It pick's an object randomly from the Objects array if no priority is set.

Which is the best option, in my opinion. If the user wants to to mine both copper and tin it will. If it clicks the closest object every time, it will mine one or the other 90% of the time (whichever one it walks closest to).

Like I said, we can add the option to click the closest object; however, I'm not really sure if it's necessary. An attribute could be added to TScript since this would only be necessary for certain scripts (such as a chicken killer).

Camaro'

2010-11-06 12:22:29

From: Coh3n
Which is the best option, in my opinion. If the user wants to to mine both copper and tin it will. If it clicks the closest object every time, it will mine one or the other 90% of the time (whichever one it walks closest to).

Like I said, we can add the option to click the closest object; however, I'm not really sure if it's necessary. An attribute could be added to TScript since this would only be necessary for certain scripts (such as a chicken killer).


Thats one example when the closest object wouldn't work too well. More often than not it will benefit by finding the closest object.

Coh3n

2010-11-06 12:47:09

[QUOTE=Camaro';747976]Thats one example when the closest object wouldn't work too well. More often than not it will benefit by finding the closest object.
No it wouldn't.

If the user fills out more than on object, they want to auto all of them, not just one a lot more than the other. If there's only one object filled out, then it will click the closest one.

Fighting scripts that have more than one type of the same monster (chickens, goblins) are really the only times I can think of where you would want to click the closest object (when there's multiple objects).

Remember that if there's only one object, it will still click the closest one.

Camaro'

2010-11-06 15:20:19

From: Coh3n
No it wouldn't.

If the user fills out more than on object, they want to auto all of them, not just one a lot more than the other. If there's only one object filled out, then it will click the closest one.

Fighting scripts that have more than one type of the same monster (chickens, goblins) are really the only times I can think of where you would want to click the closest object (when there's multiple objects).

Remember that if there's only one object, it will still click the closest one.


I think its more needed then you might think to have a option to find the closest object when theres more then one object and there are no priorities set.

Regardless, my questions were answered. Thanks :)

Coh3n

2010-11-06 17:07:49

A good argument is backed up with evidence. ;)

And regardless of if it would be used once or a hundred times, if the option is needed, its needed. I thik it would be best added to TScript and have the object functions edited properly.

Coh3n

2010-11-08 20:31:57

This has been committed. :)

There's now an attribute in the TScript type (ClickClosest). Set this to true in the record if you want to click the closest object to the player. I didn't test with chickens, but I modified other parts of MSI to test with trees, so it should work. :)

Camaro'

2010-11-08 20:50:55

From: Coh3n
This has been committed. :)

There's now an attribute in the TScript type (ClickClosest). Set this to true in the record if you want to click the closest object to the player. I didn't test with chickens, but I modified other parts of MSI to test with trees, so it should work. :)


Awesome job! :)