Page 1 of 1

Scripting target question

PostPosted: Tue Jan 02, 2024 5:17 pm
by kai
What are valid options for script action {Character name} in case I want to use the current selected char?

Re: Scripting target question

PostPosted: Wed Jan 31, 2024 12:54 am
by BlueSalamander
My apologies for replying late. :oops:

Normally, you'd use either {PARTY LEADER} or {AVATAR}.

Alternatively, if it's a character to be selected by the player during the dialogue, you would save the name of the selected character in a variable, then use {Selected Character} if you've named the variable Selected Character.

Cheers! Best regards 8-)

Re: Scripting target question

PostPosted: Wed May 01, 2024 3:24 pm
by kai
Sorry to revisit it. just for context: I'm trying to create a script that restore a single spell level by expending health from the caster.
my understanding is that script currently need to be attached to an item (since we cant create feats at this time). the problem I'm having is with the targeting of the script . I want it to execute against the char with the item (not party leader) and not all party. any suggestion what should I use for target for the script?

Re: Scripting target question

PostPosted: Mon May 06, 2024 3:29 pm
by BlueSalamander
Oh I see, thank you.

I've just added the possibility to retrieve the name of the item user or caster, for version 1.71. It will be set through the script command that you can use to set in a variable the party's gold, level, etc. You'll just have to select "Name of the item user or caster".

During combat, using that same script command, you can already select "Name of the acting character, if the acting character is a party member". But I don't think that will work out of combat.

Finally, you could allow the player to select the target character out of all the party members.

Thank you! Best regards 8-)

Re: Scripting target question

PostPosted: Thu May 16, 2024 7:46 pm
by kai
Thank you !
I'm now able to restore a specific spell slot . my next issue is to damage the caster 3x spell level. I tried using script give HP as it's supposed to take negative values but I can get the damaged applied to the char.
Is there a script documentation somewhere ? also is there a more effective search functionality in the module editor to find specific functionality (like damage )?

Re: Scripting target question

PostPosted: Thu May 16, 2024 10:31 pm
by BlueSalamander
Hello kai! :)

Thank you for your message. Unfortunately, I see now that there's a bug with the Give HPs script command. I've just fixed it for version 1.72.

Now for your second question, please open in a text editor (notepad will do) the following file:

C:/Program Files (x86)/Steam/steamapps/common/Knights of the Chalice 2/Data/Commands.mla

It contains the list of all of the commands. You can use the search function of your text editor.

The game's help entries may also contain some information about the Script Editor.

Have a great time! Best regards 8-)

Re: Scripting target question

PostPosted: Fri May 17, 2024 1:39 am
by kai
Thank you for the quick response BlueSalamander !
and thank you for fixing the bug. the only issue I now need to wait until the next version, I dont supposed there is a way that you release a minor patch or give me file to replace so I can fix it until 1.72 is release ?

and finally thanks for the link the doc - this is extremally useful to any module builder so may I suggest that you maybe link it from within the module editor ?

Thanks again !

Re: Scripting target question

PostPosted: Fri May 17, 2024 7:52 am
by BlueSalamander
Thank you kai! It's not very convenient for me to do what you're asking, but 1.72 shouldn't take too long. In the meantime, please just create and keep your scripts as if the command was already working.

Thank you for your suggestion on Commands.mla! I'm taking a note. At the least, I can add a mention of the file in the Help Entry dedicated to the Module Editor.

Best regards :)