INT_VAR, STR_VAR, je n'y comprend rien
Posté : jeu. 04 déc. 2025, 21:45
j'ai écris ce code fonctionnant à l'aide d'une fonction fournie par subtledoctor :
Je dois la répéter 8 fois et je la trouve longue, ça va faire un paquet de lignes. je voudrais donc ne les écrire qu'une fois dans un "DEFINE_PATCH_FUNCTION" puis l'appeler en indiquant à chaque fois le nouveau sort.
J'ai écris ça :
Sauf que c'est totalement foireux, weidu bloque sur la première ligne "LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~CLERIC~ num_allowed = ~1~ END"
Comme je m'en doutais un peu parce que même en copiant dans les autres mods je suis toujours autant une quiche, est ce que quelq'un pourrait m'aider svp ?
Note : et encore, ce code limite l'ajout du nouveau hla à tous les kits de pretre vanilla. Je cherche depuis deux jours à faire qu'il soit ajouté à TOUS les kits de pretre (y compris de mods), mais ça aussi je n'y arrive pas. Mais c'est un autre sujet.
Code : Tout sélectionner
LAF RES_NUM_OF_SPELL_NAME
STR_VAR spell_name = ~WIZARD_PX_PURGE_OF_MAGIC~
RET spell_res
END
COPY_EXISTING ~%spell_res%.spl~ ~Derats_Magasin_2/TempDir/pxl2cd34.spl~ WRITE_SHORT 0x1c 2 WRITE_LONG 0x1e BIT30
ADD_SPELL ~Derats_Magasin_2/TempDir/pxl2cd34.spl~ 1 7 DRUIDIC_PX_PURGE_OF_MAGIC
LAF action_add_hla STR_VAR kit_name = ~CLERIC~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~FIGHTER_CLERIC~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~CLERIC_MAGE~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~CLERIC_THIEF~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~FIGHTER_MAGE_CLERIC~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~CLERIC_RANGER~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~GODTALOS~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~GODHELM~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~GODLATHANDER~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~OHTYR~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ END
LAF action_add_hla STR_VAR kit_name = ~OHTEMPUS~ ability = ~GA_pxl2cd34~ num_allowed = ~1~ ENDJ'ai écris ça :
Code : Tout sélectionner
DEFINE_PATCH_FUNCTION Cleric_hla
STR_VAR
Spell = ~~
BEGIN
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~CLERIC~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~FIGHTER_CLERIC~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~CLERIC_MAGE~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~CLERIC_THIEF~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~FIGHTER_MAGE_CLERIC~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~CLERIC_RANGER~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~GODTALOS~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~GODHELM~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~GODLATHANDER~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~OHTYR~ num_allowed = ~1~ END
LAF action_add_hla INT_VAR ability = ~%spell%~ STR_VAR kit_name = ~OHTEMPUS~ num_allowed = ~1~ END
END
LAF RES_NUM_OF_SPELL_NAME
STR_VAR spell_name = ~WIZARD_PX_MASS_RAGE~
RET spell_res
END
COPY_EXISTING ~%spell_res%.spl~ ~Derats_Magasin_2/TempDir/pxl2cd35.spl~ WRITE_SHORT 0x1c 2 WRITE_LONG 0x1e BIT31
ADD_SPELL ~Derats_Magasin_2/TempDir/pxl2cd34.spl~ 1 7 CLERIC_PX_MASS_RAGE
LPF Cleric_hla STR_VAR spell = ~pxl2cd34~ ENDComme je m'en doutais un peu parce que même en copiant dans les autres mods je suis toujours autant une quiche, est ce que quelq'un pourrait m'aider svp ?
Note : et encore, ce code limite l'ajout du nouveau hla à tous les kits de pretre vanilla. Je cherche depuis deux jours à faire qu'il soit ajouté à TOUS les kits de pretre (y compris de mods), mais ça aussi je n'y arrive pas. Mais c'est un autre sujet.