Jump to content


Photo

how to make a new script action...?


  • Please log in to reply
2 replies to this topic

#1 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 07 May 2015 - 07:59 AM

So, six years ago Ascension64 wrote this about his brand new little TobEx utility:

"You can add all kinds of things - new effects, new script triggers and actions, new GUI options, etc."

My question is, does anyone know how we might do so? :P

Specifically, I'd like to add a script action that can toggle the OriginalClass fields which are at bits 3 through 8 of offset 0x0010 of the bg2 .CRE file's extended header. Those bits can be changed by Near Infinity or Weidu with no problem, but there's currently no in-game way to affect them.

In fact TobEx currently adds a script trigger that can read the OriginalClass bits, which is added to TRIGGER.IDS... but it doesn't have a corresponding script action to actually manipulate the values.

The vanilla game does have a script action that toggles fallen ranger status, which is controlled by the very next bit after the OriginalClass ones. Is there any way to clone the fallen ranger script action, and modify the new one to target the OriginalClass field(s)? And then add the result(s) to ACTION.IDS?

Inquiring minds want to know.

Edited by subtledoctor, 07 May 2015 - 08:02 AM.


#2 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 07 May 2015 - 09:39 AM

TobEx uses a mixture of C++ code and assembly code. If you are a C++ guru you can try to wade through the whole source code of TobEx and add your own stuff. It's freely available on GitHub.



#3 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 07 May 2015 - 01:34 PM

Ah, that's what I was afraid of. I've learned to do some task-oriented stuff in AppleScript and Weidu, but I've never so much as looked at 'real' programming languages like C++.

Edited by subtledoctor, 07 May 2015 - 01:35 PM.