subtledoctor Posted March 13, 2017 Share Posted March 13, 2017 I have five fighter combat techniques - two melee hit effects, and three AC bonuses (vs. different weapon types). The player can learn the techniques over the course of the game, but I would like to simulate enemy creatures knowing the techniques and using them against the player. Easy enough with ADD_CRE_EFFECT, since the techniques all consist of permanent spell effects. So I want to go through every .CRE and, if the class = fighter, apply one of these five effects. Should I just repeat a counter from 1 to 5 as Weidu goes over each .CRE, so that the randomness is down the the alphabetical sorting of the files? Or is there is way to actually randomly pick one of the five effects for each .CRE? Link to comment
argent77 Posted March 13, 2017 Share Posted March 13, 2017 You can also use WeiDU's RANDOM function. Link to comment
subtledoctor Posted July 13, 2017 Author Share Posted July 13, 2017 RANDOM seems a bit weird in the Weidu readme... it's under "value" with stuff like STRING_EQUAL_CASE and similar stuff - basically, stuff I usually see after ACTION_IF or PATCH_IF. Can I use it like this? COPY_EXISTING_REGEXP GLOB ~[all non-joinable .CREs]~ ~override~ SET variable = RANDOM (1 5) PATCH_IF (%variable% = 1) BEGIN ADD_CRE_EFFECT [#1] END PATCH_IF (%variable% = 2) BEGIN ADD_CRE_EFFECT [#2] END PATCH_IF (%variable% = 3) BEGIN ... [etc.]?? Link to comment
Ardanis Posted July 14, 2017 Share Posted July 14, 2017 Yes https://github.com/Gibberlings3/SpellRevisions/blob/master/spell_rev/components/fix_spellbooks.tpa#L70 Link to comment
Jarno Mikkola Posted July 14, 2017 Share Posted July 14, 2017 COPY_EXISTING_REGEXP GLOB ~[all non-joinable .CREs]~ ~override~ SET variable = RANDOM (1 5) You might like to print out the seeded number just cause... of debugging, as you can later set the seed to that number for toils and tremors. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.