Jump to content


Photo

Weapon Style proficiency to add extra attacks?

quick question

  • Please log in to reply
21 replies to this topic

#21 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 29 October 2016 - 07:55 PM

Okay... Just tried to figure it again and...
Sorry! I need more help to understand...

I'll try to explain stuff. The first thing I did, in order for opcode 326 to work with my new SWS abilities, is append two rows to SPLPROT.2da:
APPEND ~splprot.2da~ ~PROF_SWS%TAB3%TAB%-1%TAB%4~
APPEND ~splprot.2da~ ~PROF_NOSWS%TAB4%TAB%-1%TAB%4~
So you added the 3 lats lines: https://s14.postimg....e6nght/img1.jpg
In the first column, is the naming irrevelant so long its not repeated in the list?
Yes. As you will see below, I use those names to find the row # for use in the opcode 326 or 318 effects. Honestly, best practice would be to use your modding prefix in those row names, so things don't get mixed up between mods.
 
But how can you tell that opcode 326 is going to check the exact row(s) that you appended into the splprot.2da and ignore all the rest in there?
Because of those names - "PROF_SWS" and "PROF_NOSWS" respectively - give each row something unique I can tell Weidu to find, and then set a variable to represent the row # of the row with that unique marker: 
COPY_EXISTING ~splprot.2da~ ~override~
	COUNT_2DA_COLS cols // amount of columns
	READ_2DA_ENTRIES_NOW rows cols // read all file into memory  
	FOR (row = 1; row < rows; ++row) BEGIN // iterate over rows
	  READ_2DA_ENTRY_FORMER rows row 0 ~stat~ // read column value
	  PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~PROF_SWS~ BEGIN
	    SET sws_row = %row%
	  END
	  PATCH_IF ~%stat%~ STRING_EQUAL_CASE ~PROF_NOSWS~ BEGIN
	    SET nosws_row = %row%
	  END
	END
BUT_ONLY
You also used a 137 value that is not listed: https://s10.postimg....pugerd/img1.jpg
No - 137 just happens to be the SPLPROT.2da row encoded in the variable I just set above, when I looked for those markers. I only specified the "%nosws_row%" variable:
LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 318 target = 1 parameter1 = 2 parameter2 = %nosws_row% timing = 2 resist_dispel = 0 STR_VAR resource = ~d5_sws2~ END
For STAT column the 112 and 113 are are the fighting styles, but the 134 means what? "no single weapon style"? Where did you got 134 from?
Proficiency 134 is simply an empty stat, not used by the game or (to my knowledge) any mods. It's useful to me because it is a proficiency, so it can be manipulated by opcode 233.

See, one problem with setting this up for SWS is that I can add effects to weapons that check for whether you have specialization with SWS... BUT if you dual-wield two of those weapons, they will BOTH give you that bonus. Which sort of destroys the whole point of a bonus that is only supposed to work with SWS, i.e. only if you are NOT dual-wielding.
 
SO, I set every 1-handed weapon to incrementally increase your proficiency with this empty proficiency; and then use opcode 318 to check whether you have "specialization" in that empty proficiency (which would only happen if you are carrying two 1-handed weapons, i.e. dual-wielding) and in that case it makes you immune to the SWS bonuses.
 
Honestly, I think that bit was rather clever.
 
In VALUE column theres a 2 (amount of proficiency points in SNS?) but the -1 for the other entries I don't get, can you explain?
 I believe if you put '-1' in that field then it will read the value from parameter1 of your 326 effect, meaning your effect can specify different values to check.
 
The RELATION column I don't get at all since the values are too high to make any sense for weapons tyles...
The RELATION column of SPLPROT.2da is described here:
http://gibberlings3....=26809&p=228874
 
Btw if anyone wants to see the raw code to get this done, and follow along with this discussion, it is here, from lines 603 to 660:
https://github.com/s..._WPO_styles.tpa

Edited by subtledoctor, 29 October 2016 - 07:57 PM.


#22 Himself

Himself

    CEO of the ENDLESS WAVES OF BAD DOGGIE

  • Member
  • 230 posts

Posted 31 October 2016 - 10:33 AM

Okay and guess I understand now, will try to reproduce for my own ends and come back if something goes odd.

 

Thanks a lot doc!  :new_thumbs:


Edited by Himself, 31 October 2016 - 10:34 AM.

...to be isn't important, we're no longer than we're :)