forgottenserver icon indicating copy to clipboard operation
forgottenserver copied to clipboard

Action register as position (Revscripts)

Open DonOreo opened this issue 2 years ago • 7 comments

I saw that in the revscripts for movement it has to register as position type, I mean as movement: movement:position(Position(1000, 1020, 7)) Instead of placing id, aid or uid, in this case it is position

Well in fact they have a post that they have uploaded years ago. https://github.com/otland/forgottenserver/pull/2646/files

I wanted to know if it would also be possible for a future for action, instead of adding by aid or uid, in this case I want to do it by position.

Here is an example

local action = Action()

function action.onUse(player, item, target, position, fromPosition, toPosition)
	player:say("hi friend.")
	return true
end

action:position(Position(1000, 1020, 7))
action:register()

It would be very useful and more effective to not be adding the aid or uid in the remere map editor.

DonOreo avatar Jul 27 '23 02:07 DonOreo

for moveevent it totally makes sense, but for action I'm strongly against it, players use an item/object, not a position

but let's see what others think

EPuncker avatar Jul 27 '23 04:07 EPuncker

Yes, I honestly don't see anything wrong with it, that is, to avoid adding aid or uid, it is a good alternative to place position on it.

In the case of movement when placing position on it, if you stand on it then it does the function.

In the case of Action, if you click on the position that you have placed, then it does the function.

I hope they make the right decision hehehe.

DonOreo avatar Jul 27 '23 15:07 DonOreo

but position of what? Ground? An item on the ground? Anything that will be used on that position?

marmichalski avatar Jul 27 '23 23:07 marmichalski

but position of what? Ground? An item on the ground? Anything that will be used on that position?

Yes, exactly, just click on the ground or wherever you have the position, the wall, statue, water, any object, etc.

It's like putting an action ID or unique ID to the object, but in this case you also have the possibility to put a position if you want.

Basically it would work by simply clicking on the position you have placed

DonOreo avatar Jul 28 '23 02:07 DonOreo

but position of what? Ground? An item on the ground? Anything that will be used on that position?

It's like putting an action ID or unique ID to the object, but in this case you also have the possibility to put a position if you want.

No, it is not the same. AID/UID is assigned to specific object that you use. With position, you can trash the tile with items and still be able to execute the script? That was the question.

So take doublet quest for example. You use a ground tile, but what if that tile is trashed? What if different usable item (say meat) is moved onto that position? Should I consume the meat or execute the position action when I use it?

marmichalski avatar Jul 28 '23 07:07 marmichalski

but position of what? Ground? An item on the ground? Anything that will be used on that position?

It's like putting an action ID or unique ID to the object, but in this case you also have the possibility to put a position if you want.

No, it is not the same. AID/UID is assigned to specific object that you use. With position, you can trash the tile with items and still be able to execute the script? That was the question.

So take doublet quest for example. You use a ground tile, but what if that tile is trashed? What if different usable item (say meat) is moved onto that position? Should I consume the meat or execute the position action when I use it?

Good point, I had not thought of that, then it would be more useful on walls, trees, statues, well in short on objects to which you can not throw objects.

Unless a modification is made so that they do not throw objects in that position.

If I put the position for example of the statue it will still work even if the statue is not there, since it will register it by position.

DonOreo avatar Jul 28 '23 14:07 DonOreo

Well i already do it for movements make alot easier to create events, i'm current using globalevents to handle positions and events in same script.

Every time i need to create an movement to check something i do using coordinates its better.

But in action thats depends on what you doing in some cases will be not useful, but should be good if its possible to do also.

Underewarrr avatar Aug 24 '23 18:08 Underewarrr

There're just to much circumstances on why this should not be implemented, if we enable it people will use it in a non intended way and then complain that it doesn't work correctly.

EvilHero90 avatar May 14 '24 15:05 EvilHero90