Jump to content


Photo

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


9 replies to this topic

#1 plainab

plainab

    Sasha al'Therin

  • Members
  • 1717 posts
  • Gender:Male
  • Location:Lost on the Sword Coast

Posted 31 August 2008 - 03:24 PM

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.
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm

#2 Avenger

Avenger
  • Modders
  • 3388 posts
  • Gender:Male
  • Location:Hungary

Posted 31 August 2008 - 10:34 PM

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

#3 plainab

plainab

    Sasha al'Therin

  • Members
  • 1717 posts
  • Gender:Male
  • Location:Lost on the Sword Coast

Posted 01 September 2008 - 10:15 AM

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
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm

#4 igi

igi

    IESDP Guardian

  • Gibberlings
  • 1210 posts
  • Gender:Male

Posted 02 September 2009 - 07:01 AM

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.

#5 plainab

plainab

    Sasha al'Therin

  • Members
  • 1717 posts
  • Gender:Male
  • Location:Lost on the Sword Coast

Posted 02 September 2009 - 07:12 AM

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...
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm

#6 Guest_i30817_*

Guest_i30817_*
  • Guests

Posted 15 September 2011 - 03:12 AM

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

#7 Avenger

Avenger
  • Modders
  • 3388 posts
  • Gender:Male
  • Location:Hungary

Posted 15 September 2011 - 07:43 AM

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

#8 Guest_i30817_*

Guest_i30817_*
  • Guests

Posted 15 September 2011 - 08:53 AM

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?

#9 Guest_i30817_*

Guest_i30817_*
  • Guests

Posted 15 September 2011 - 09:05 AM

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.

#10 Guest_i30817_*

Guest_i30817_*
  • Guests

Posted 15 September 2011 - 09:08 AM

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.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users