Scripting: Variable math operations

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

Scripting: Variable math operations

Postby Enrahim » Sun Jul 05, 2020 12:11 pm

Hi! I skimmed the script commands. It covers a lot of ground. However I did not notice anything to the effect of "Set(*variable*) to (*variable*) or (*0*) (*operation*) (*variable*) or (*0*)". This seem to me like such a basic scripting capability that I would like to either get it a bit more prominently advertised, or added? (Without knowing the internals of your scripting engine I believe it is likely to be quite straight forward to implement with operations pluss, minus, divide, multiply and preferably also modulo/remainder)
Enrahim
Lizardman (CR 1)
Knights of the Chalice 2
Kickstarter Knight
 
Posts: 4
Joined: Sun Jul 05, 2020 12:02 pm

Scripting: Variable math operations

Advert
 

Re: Scripting: Variable math operations

Postby BlueSalamander » Thu Mar 04, 2021 9:34 pm

Yup, you can do the math operations using the script command 'set variable'.

Set in variable ~ the value ~ or number value ~.

In the field 'number value' you can place any expression containing variables and traditional math operators (though I don't think modulo will work). Cheers :)
'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: 1902
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 4 guests

cron