Scripting target question

Feel free to discuss anything related to the creation of new KotC 2 adventures using the toolset.

Scripting target question

Postby kai » Tue Jan 02, 2024 5:17 pm

What are valid options for script action {Character name} in case I want to use the current selected char?
kai
Griffon (CR 4)
Knights of the Chalice
 
Posts: 12
Joined: Mon Apr 22, 2013 11:16 pm

Scripting target question

Advert
 

Re: Scripting target question

Postby BlueSalamander » Wed Jan 31, 2024 12:54 am

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-)
'Say there is a chunk of meat. Pirates will have a banquet and eat it! But heroes will share it with other people. I want all the meat!!' - Luffy in One Piece
User avatar
BlueSalamander
Master Conjuror
 
Posts: 1920
Joined: Sun May 18, 2008 6:20 pm

Re: Scripting target question

Postby kai » Wed May 01, 2024 3:24 pm

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?
kai
Griffon (CR 4)
Knights of the Chalice
 
Posts: 12
Joined: Mon Apr 22, 2013 11:16 pm

Re: Scripting target question

Postby BlueSalamander » Mon May 06, 2024 3:29 pm

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-)
'Say there is a chunk of meat. Pirates will have a banquet and eat it! But heroes will share it with other people. I want all the meat!!' - Luffy in One Piece
User avatar
BlueSalamander
Master Conjuror
 
Posts: 1920
Joined: Sun May 18, 2008 6:20 pm

Re: Scripting target question

Postby kai » Thu May 16, 2024 7:46 pm

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 )?
Attachments
hp2 (Custom).png
hp2 (Custom).png (245.31 KiB) Viewed 2751 times
kai
Griffon (CR 4)
Knights of the Chalice
 
Posts: 12
Joined: Mon Apr 22, 2013 11:16 pm

Re: Scripting target question

Postby BlueSalamander » Thu May 16, 2024 10:31 pm

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-)
'Say there is a chunk of meat. Pirates will have a banquet and eat it! But heroes will share it with other people. I want all the meat!!' - Luffy in One Piece
User avatar
BlueSalamander
Master Conjuror
 
Posts: 1920
Joined: Sun May 18, 2008 6:20 pm

Re: Scripting target question

Postby kai » Fri May 17, 2024 1:39 am

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 !
kai
Griffon (CR 4)
Knights of the Chalice
 
Posts: 12
Joined: Mon Apr 22, 2013 11:16 pm

Re: Scripting target question

Postby BlueSalamander » Fri May 17, 2024 7:52 am

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 :)
'Say there is a chunk of meat. Pirates will have a banquet and eat it! But heroes will share it with other people. I want all the meat!!' - Luffy in One Piece
User avatar
BlueSalamander
Master Conjuror
 
Posts: 1920
Joined: Sun May 18, 2008 6:20 pm


Return to KotC 2 Forum for Adventure-Module Creation

Who is online

Users browsing this forum: No registered users and 0 guests