Jump to content

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


plainab

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.

Link to comment

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.

Link to comment

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...

Link to comment
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

Link to comment
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?

Link to comment

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.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...