Jump to content
Sign in to follow this  
plainab

52 ClickLButtonObject(O:Target*,I:ScrollSpeed*Scroll)

Recommended Posts

A bit of info for the IESDP concerning 52 ClickLButtonObject(O:Target*,I:ScrollSpeed*Scroll) I have successfully used it in my party ai script. Included is a sample block. Unfortunately, I look for things within the current game resources and fill in variables on the fly, but you should still be able to see what happens. Here it is:

IF
HotKey(%F1%)
Global("%cont_var%","LOCALS",0)
ActionListEmpty()
!Exists([ENEMY])
!See([NOTGOOD])
AreaCheck("%area%")
!Disarmed("%trigger%")
Range("%trigger%",10)
CheckStatGT(Myself,1,TRAPS)
CheckStatGT(Myself,1,LOCKPICKING)
THEN
RESPONSE #100
SetGlobal("%cont_var%","LOCALS",1)
RemoveTraps("%trigger%")
PickLock("%trigger%")
ClickLButtonObject("%trigger%",0)
END

In this example,

IF

a hotkey is pressed

the current character has not tried this container before (the locals variable)

is idle

sees no enemy

sees no one to call guards

is in the area of the container

has not disarmed the container

is within a range of 10 to the container

has some skills in traps

and has some skills in lockpicking

THEN

tell themselves they've tried it (the locals variable)

remove the trap

pick the lock

and then using the action ClickLButtonObject(O:Target*,I:ScrollSpeed*Scroll) open the container interface as if you had used your mouse pointer to highlight and then pressed the left button to open.

 

The speed setting is most likely related to the scroll.ids file. In my case 0 was appropriate.

 

I would assume all of the clickRbutton or clickLbutton actions are in relation to what the player could do with the mouse. That assumption is what led me to try this out. Feel free to take this info and modify as necessary. You can even install my party script choosing the appropriate hotkey action and take a sample block from there instead of using this one with the tp2 variables. Script link is in my signature file.

Share this post


Link to post
Interesting.

I guess scrollspeed counts when the object isn't on screen.

It still scrolled from my view point to the container, but I wanted the container to open right away. Hence, the use of 0

Share this post


Link to post

When I tried this, the game-screen jumped to the top left of the map and wouldn't move. If somone can confirm this work correctly (I intend to download plainab's mod when I get a chance and see it in action there) I'll add it to the IESDP though.

Share this post


Link to post

I think you need to have a valid object that is in the area. I only tested it with containers. Also, the container was already within visible range. Don't know if any of that makes a difference.

 

You could say that it jumps rather than scrolls, but 0 is instant. I don't remember if I was able to get any of the other numbers to work or not.

 

Keep in mind, the script was for the BG2 engine (EasyTutu was the test platform) so it's usage is limited to that...

Share this post


Link to post
Guest i30817

How does that trigger object thing works? Is it the object under the cursor?

Share this post


Link to post
How does that trigger object thing works? Is it the object under the cursor?

No, it is the scripting name (or some other object reference) written in the script (1st parameter of the action).

It is the %trigger% part in this script, but i don't have any idea how could you supply a meaningful runtime value

Share this post


Link to post
Guest i30817
How does that trigger object thing works? Is it the object under the cursor?

No, it is the scripting name (or some other object reference) written in the script (1st parameter of the action).

It is the %trigger% part in this script, but i don't have any idea how could you supply a meaningful runtime value

 

As you say, I'd love that some kind of auto disarming script could be possible, but this seems like it's not dynamic - the See() trick will only work with NPC's too.

 

In fact i checked IESDP and there doesn't seem to be any trap object identifier (in IESDP terms).

 

The alternative is some kind of user input, and a mapping from the cursor to the object like i guess that IE uses when you click on a locked container with thief skills button on.

 

Nothing like that on baldur.bsc i imagine?

Share this post


Link to post
Guest i30817

Maybe it's possible to do something completely dumb such as attaching a script to all traps in the game that saves the trap reference in a list when it is detected (by attaching that to their scripts) and then using that to check for near traps when you press f1.

 

Problem is, no cycles i guess (though you probably could try 10 traps per map or something dumb like that and put 10 distance checks in your script.

 

It seem horrendous and would require me to learn weidu.

Share this post


Link to post
Guest i30817

Not to mention: that a trap can be nearer to you and still require to step over another to get to it.

 

:cool:

 

No, using the cursor seems the only good way.

Share this post


Link to post
Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...