Why is everyone on this forum so insanly knowledgeble?

When i see other people mod, they like have either success at once, or they have 2-3 tries and some has a single pointer and everything is fixed...
This is me adding a projectile to a ranged item ability:
You see my struggle? xD
This is me adding a projectile to a ranged item ability:
// WRITE_SHORT 0x098 ~%GelStar%~ // ALTER_ITEM_ABILITY ~RANGED~ INT_VAR projectile = %GelStar% END // LFP ~ALTER_ITEM_ABILITY~ INT_VAR ability_type = 2 projectile = %GelStar% END // ALTER_ITEM_ABILITY ~RANGED~ INT_VAR ability_type = 2 projectile = %GelStar% END // ALTER_ITEM_ABILITY ~RANGED~ projectile = %GelStar% END // LPF ALTER_ITEM_ABILITY_HEADER INT_VAR projectile = %GelStar% END // ALTER_ITEM_ABILITY ~2~ projectile = %GelStar% // ALTER_ITEM_ABILITY 2 projectile = %GelStar% // ALTER_ITEM_ABILITY 2 projectile = ~%GelStar%~ // ALTER_ITEM_ABILITY ~2~ projectile = ~%GelStar%~ // ALTER_ITEM_ABILITY ~2~ projectile = ~GelStar.pro~ // ALTER_ITEM_ABILITY ~2~ projectile ~%GelStar%~ // LPF ALTER_ITEM_ABILITY_HEADER INT_VAR projectile = %GelSmok% END // ALTER_ITEM_ABILITY ~2~ projectile = ~~%GelStar%~~ // ALTER_ITEM_ABILITY ~0~ ability_type = 2 projectile = %GelStar% // ALTER_ITEM_ABILITY ~0~ projectile = %GelStar% // ALTER_ITEM_ABILITY ~0~ projectile EQUALS %GelStar% // ALTER_ITEM_ABILITY 0 projectile ~%GelStar%~ // ALTER_ITEM_ABILITY 0 projectile %GelStar% // ALTER_ITEM_ABILITY ~0~ projectile %GelStar% // ALTER_ITEM_ABILITY ~0~ projectile ~%GelStar%~ // ALTER_ITEM_ABILITY ~RANGED~ INT_VAR ability_type = 2 projectile = ~%GelStar%~ // ALTER_ITEM_ABILITY ~RANGED~ INT_VAR ability_type = 2 projectile = %GelStar% // PATCH_IF (SOURCE_SIZE > 0x71) BEGIN // LPF ~ALTER_ITEM_ABILITY~ INT_VAR type = 2 projectile = %GelStar% END // END // BUT_ONLY //PATCH_IF (SOURCE_SIZE > 0x71) BEGIN // ALTER_ITEM_ABILITY ~RANGED~ projectile = %GelStar% //END //BUT_ONLY //PATCH_IF (SOURCE_SIZE > 0x71) BEGIN // ALTER_ITEM_ABILITY 0 projectile = %GelStar% //END //BUT_ONLY // PATCH_IF (SOURCE_SIZE > 0x71) BEGIN // ~ALTER_ITEM_ABILITY 0~ projectile = ~%GelStar%~ // END // BUT_ONLY //PATCH_IF (SOURCE_SIZE > 0x71) BEGIN // LPF ALTER_ITEM_ABILITY 0 projectile = ~%GelStar%~ END //END //BUT_ONLY //PATCH_IF (SOURCE_SIZE > 0x71) BEGIN // LPF ~ALTER_ITEMABILITY~ INT_VAR ability_type = 2 projectile = ~%GelStar%~ END //END //BUT_ONLY //ALTER_ITEM_ABILITY 0 INT_VAR type = 2 projectile = %GelStar% //ALTER_ITEM_ABILITY 0 projectile = ~GelStar.pro~ //SET GelStarProjID = %last_added_projectile% //ALTER_ITEM_ABILITY projectile = %GelStarProjID% //ALTER_ITEM_ABILITY INT_VAR projectile = ~GelStar.pro~ //ALTER_ITEM_ABILITY projectile = ~GelStar.pro~ ALTER_ITEM_ABILITY projectile = %GelStar%
You see my struggle? xD
0
Comments
How did I know that? I have a copy of the WeiDU documentation open in another tab, and I ran a search for ALTER_ITEM. It's a very useful reference. (No link, because the address of a file on my computer wouldn't help you. It can be found online, but I don't have a URL handy)
Now, about those various ~~ and %% bits ...
Both tildes and percent signs are string delimiters. If you have one layer of that, it means "treat whatever's inside as a string". And if you don't have that ... well, what you put there is already a string. So there's no difference between GelStar, ~GelStar~, and %GelStar%; the delimiters would only matter if they were enclosing something with spaces or other format-relevant characters.
The second layer? Well, %% when you're already inside a string means "evaluate this as a variable". If you have an EVAL layer, as in AUTO_EVALUATE_STRINGS. Which would matter, except that the field you're trying to fill is looking for an integer - feed it a string, and it'll already automatically evaluate it as a variable in an attempt to get an integer out of it. So ~%GelStar%~ is also the same as GelStar.
In this case, none of those ~~ and %% actually matter. Once you get the right function and the right syntax to launch it, any of those versions will work. Assuming you have in fact previously defined that variable, which isn't part of the code in this thread.
After i have attemped like 30-40 things im starting to understand some.
The last string/code here actually worked :P
I could not copy all because item had long descriptions etc.
But it was something like:
In the end i understood that ADD_PROJECTILE has autofunctions which stores last added projectile and refresh IDS. As well as i guess this is a kind of function block i now work on undearneath? And that this is the reason why i use %GelStar% function?
As you can see i was close to ur version:
// LPF ALTER_ITEM_ABILITY_HEADER INT_VAR projectile = %GelSmok% END
So if i Scratched ABILITY in this line, would it work? I kinda struggle to see what i target now. I think i would need:
LPF ALTER_ITEM_HEADER INT_VAR type = 2 projectile = %GelSmok% END
But the issue there is that i have no referense to ability... So im trying to add a projectile to the item itself, and the item itself has no projectile. Its the ability that has it...
So i would need something like:
LPF ALTER_ITEM_HEADER INT_VAR ABILITY type = 2 projectile = %GelSmok% END
But that is probarly wrongly formulated...
So in the end the shortest working method which im actually understanding somewhat what im doing ended up wokring:
ALTER_ITEM_ABILITY projectile = %GelStar%
But it took me like 4 hours to add that single line correctly xD
I also tried ALTER_ITEM_ABILITY 0, but lets say you had 3 different ranged albilities, and i wanted to specify one of them, then i think the issue is that NearInfinity Starts at Item Albility 0, meanwhile weidu maby starts counting from 1?
Im kinda stuck offshore at work, so i dont have my previous mods to look on. And im using a new libary for kits which makes people like me struggle heavy. As I dont know enough sadly
Even a simple Spell description ended up at the wrong place.
I tried SAY DESC on that.
Dno what i should use :P
The code i used just allowed me to install my mod, and it also blocked the previous projectile i add to a spell to also add it to my ninja stars.
So I thought i had success due to item files copied already had the projectile added manual and exported.
So when i try to install it to bgee instead of bg2ee they end up with same projectile id, only its flamestrike or something xD
So now i dont know again.
I understand i should use ALTER_ITEM_HEADER, but not how to properly target the item ability etc xD
This would be my best guess:
ALTER_ITEM_HEADER ability = 2 projectile = %GelStar%
Is that correct or even remotely close?
Ranged(2) so ability should be = 2? To make sure i enter the ability section.
ALTER_ITEM_HEADER item ability = 2 projectile = %GelStar%
ALTER_ITEM_HEADER ability 1 = 2 projectile = %GelStar%
LPF ALTER_ITEM_HEADER ability = 2 projectile = %GelStar% END
See, i have no idea what im doing xD
So, a minimal call of this function to do what you're trying to do: This will change the item's second ability to use your new projectile. Leave any of the pieces I mentioned out, and the function call will fail with a syntax error.
ALTER_ITEM_HEADER: patch ability headers on items. This is a PATCH function. All integer variables except match_icon and header default to -1 and negative values result in no change to the corresponding field. The integer variables match_icon and header default to 0. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. The string variable icon defaults to the string "same", which results in no change to the corresponding field.
header_type is used to limit the scope of matching. The default value of -1 will match all types of headers while values of 0-4 will match headers with those values. If match_icon is 1, the icon resource reference will be match with the icon variable as an additional qualifier. This is useful for items which have multiple magic abilities. header can also be used to limit patching to the Nth header, counting from 1 as the first header. The default is 0, which will match all headers.
So based on weidu documentation and bolded sections its a patch function.
- So then i understand it so that i should use LPF (launch patch function)
- ALTER_ITEM_HEADER is the correct one.
- If i want to target specific albility, i need to choose between 1-4, meanwhile in nearinfinity this will be counting from 0. "Item Ability 0" in nearinfinity, should be 1 in weidu.
INT_VAR projectile to the new projectile.
- This one does not have any examples, so i better guess correct.
So i guess either of theese should be correct:
Google gave me an pretty excact example on how to formulate
This topic was actually genious for me xD
https://www.gibberlings3.net/forums/topic/30658-weidu-items-basic-coding-problems/
(That's my level of formal training: introductory courses.)
Also, are you trying to match a specific header, or a specific type of header, or everything? And what do you think those percent signs do? (In this context, they don't do anything useful.)
I have only made kits for baldur's gate. Zero training other than learning some PLC programming on school 2 decades ago, and a calculator in visual basic 2 decades ago. And it took a long time before i even tried anything other than naming spells and adding kits in tp2 file.
LPF ALTER_ITEM_HEADER INT_VAR projectile = %GelStar% END
So the = is the verb?
And those %, thats my issue. Lack of knowledge. All i know is that they are used if something has stored their referanse earlier, and i think ADD_PROJECTILE stores that?
To be honest, when to use ~~ % and when its a string or something else than a string is hard for me to judge.
So for me its like a need a full example, then i know how it should look like. And i learn more and more piece by piece :P
Like this kit is the first time i actually made a BAM other than portraits or simple colour changes.
It basicly takes me 10 minutes to build the spells and items in near infinity. And then it can take months to to finnish the mod because it requires a script to do what i want it to ingame :P
Thanks man
I will remember this in the future
Hello, im in dire need of help again.
Im trying to add an effect inside a item ability, which is melee.
I have tried loads of different stuff:
Also tried without the ~~ around ADD_ITEM_EFFECT
And this:
And many more.
Any idea?
I want to add OP code (139) Display string. on melee item ability.
Target preset(2)
Power 0
String Blinded
Timing instant/permanent(1)
Dispel/resistance Natural/nonmagical (0)
Duration 0
Probability 1 100
Probability 2 0
Save type (Spell)
Save bonus (2)
Last attempt this evening:
Do it need to stay on 1 line like this?
COPY ~GelGlaB/Items/GEGLA10.itm~ ~override~
SAY NAME1 ~Glass Sword +3~
SAY NAME2 ~Glass Sword +3~
PATCH_IF (SOURCE_SIZE > 0x71) BEGIN
LPF ADD_ITEM_EFFECT
INT_VAR
ability = 0 // 1 or 0?
opcode = 139 // Display string
target = 2 // Preset target
power = 0
string = RESOLVE_STR_REF(~Blinded~)
timing = 1 // Instant / Permanent
resist_dispel = 0 // Ikke magisk
probability1 = 100
probability2 = 0
savingthrow = 1
savebonus = 2
insert_point = -1 // Legg effekten sist
END
END
BUT_ONLY
Adding new OP code in item ability:
Changing based on op code.
Another change based on OP code:
Add new effect.
Now i have some new stuff to try out. Again my hope is active^^
And also add death effect:
COPY ~GelGlaB/Items/GeGla10.itm~ ~Override~