Jump to content


Photo

In desperate need of help with hotkey script!

custom script

7 replies to this topic

#1 methority

methority
  • Members
  • 3 posts

Posted 21 February 2018 - 10:36 PM

Long live and prosper to you, mighty wizards of IE modding&scripting 'n stuff. 

 

I shouldn't even be here for my misery of appropriate skills and language. But! 

 

I humbly ask you to help me with embedding a certain script in BG:EE which should make my main character Rest() (restore spells without movie and game time advanced) on demand with a hotkey.

 

In this case I have absolutely no competence or knowledge and skills to rely on.

 

My aspiration is based on this post: https://forums.beamd...ustomization/p1  section 3 - Using Custom Scripts, also I suggest involving script action  Rest() 

...somehow and make it automated with hotkey, but I have no useful ideas about it and my 15-minute experience of using DLTCEP ended fiasco. 

 

So, please, can I get any "step by step" help? 

 



#2 Roxanne

Roxanne

    Modder

  • Modders
  • 2041 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 22 February 2018 - 02:19 PM

Long live and prosper to you, mighty wizards of IE modding&scripting 'n stuff. 

 

I shouldn't even be here for my misery of appropriate skills and language. But! 

 

I humbly ask you to help me with embedding a certain script in BG:EE which should make my main character Rest() (restore spells without movie and game time advanced) on demand with a hotkey.

 

In this case I have absolutely no competence or knowledge and skills to rely on.

 

My aspiration is based on this post: https://forums.beamd...ustomization/p1  section 3 - Using Custom Scripts, also I suggest involving script action  Rest() 

...somehow and make it automated with hotkey, but I have no useful ideas about it and my 15-minute experience of using DLTCEP ended fiasco. 

 

So, please, can I get any "step by step" help? 

 

 

0x0021 HotKey(I:Key*HotKey)
Returns true only if the specified key was pressed in the last script round. Hotkeys defined in keymap.ini take precedence over hotkeys expected by this trigger.

 

96 Rest()

This action applies the benefits of resting (i.e. healing, restoring spells and restoring abilities) to the active creature. The action does not play the rest movie or advance game time.

 

IF

HotKey(X)

THEN
RESPONSE #100

StartCutScene("MyRest")

END

 

where MyRest.baf is this

IF
True()
THEN
RESPONSE #100
CutSceneId(Player1)
StorePartyLocations()
FadeToColor([20.0],0)
Wait(1)
Rest()
ActionOverride(Player2,Rest())
ActionOverride(Player3,Rest())
ActionOverride(Player4,Rest())
ActionOverride(Player5,Rest())
ActionOverride(Player6,Rest())

Wait(1)

RestorePartyLocations()

Wait(2)

FadeFromColor([30.0],0)
EndCutSceneMode()

END

 

Just a starting point, you need to test and modify it to your needs.

I have no idea where you want to put that first script that triggers the cutscene? Some NPC that must be in party, some creature you create in the area you are in? Baldur,bcs? It must be a script that already runs in the active area,


Edited by Roxanne, 22 February 2018 - 02:29 PM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#3 CamDawg

CamDawg

    Just a simple country Hyper-Chicken

  • Gibberling Poobah
  • 9434 posts
  • Gender:Not Telling

Posted 22 February 2018 - 05:24 PM

One of the neat things about EE is that you can directly execute scripting actions from the console. This will rest player1:

C:Eval('ActionOverride(Player1,Rest())')

Repeat for players 2-6.


I came here with a simple dream: a dream of killing all humans. And this is how it must end? Who's the real seven billion ton robot monster here? Not I. Not... I.


#4 Roxanne

Roxanne

    Modder

  • Modders
  • 2041 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 22 February 2018 - 10:09 PM

One of the neat things about EE is that you can directly execute scripting actions from the console. This will rest player1:

C:Eval('ActionOverride(Player1,Rest())')

Repeat for players 2-6.

This is probably what the OP was looking for...

I had my modder's view on it, far too complex thinking.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#5 methority

methority
  • Members
  • 3 posts

Posted 23 February 2018 - 01:07 AM

I want to execute this command with a hotkey, not by texting it in console. Is it possible?



#6 Roxanne

Roxanne

    Modder

  • Modders
  • 2041 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 23 February 2018 - 02:10 AM

I want to execute this command with a hotkey, not by texting it in console. Is it possible?

In this case the method with two scripts, I posted would be applicable. While the cutscene script is a *free* script, just called by the other one's action block, the first one needs some *anchor* in the game. It must be running in the active area to react to your hotkey triggering. There's many ways of doing this and depends on your circumstances.


Edited by Roxanne, 23 February 2018 - 02:11 AM.

The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#7 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6554 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 23 February 2018 - 02:54 AM

I want to execute this command with a hotkey, not by texting it in console. Is it possible?

Well, considering the console has memory of 10 last lines, using a script and hotkey script is rather much the same action. Once you have typed the code one time...

Tilde key, the upwards pointing arrow key and Enter.


Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#8 methority

methority
  • Members
  • 3 posts

Posted 23 February 2018 - 08:12 AM

I've found the weird solution spontaneously somehow. 

I've been poking around with WeiDU in an intuitive manner, copied this text:

 

IF
    HotKey(K)
THEN
    RESPONSE #100
       Rest()
END

 

Then I did save/export this as .bcs file, manually converted it to .bs file and added it to player scripts as custom script? Had no idea what I'm doing, but this custom script was accessible ingame, so I choose it for my main character and then, by coincidence, I had "turn AI on-off function" on my "K" button, so it turned out that I have to reload this party AI functionality and my "resting script" works. 

 

Sorry for grammar :)





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users