Solved How to make RM Buffs works Around in Party and Targeted without ?

Status
Not open for further replies.

Skalleey

New member
Registered
Joined
Jul 22, 2024
Messages
15
Reaction score
5
Points
3
I've been trying to figure out for a while now, how to make my RM buffs to be given around while in party to all party members (like heal rain works for heal) and be targeted while being without a party (like other Assists/RM buffs)

I've tried a lot of different configuration in propSkill.txt (Ex.: EXT_TROUPEWITH, EXT_TROUPE, WUI_NOW, WUI_TARGETINGOBJ and others) but did not manage to work, then I tried changing the Source file that called the function ApplySkillAroundTroupe inside ctrl.cpp in the Common folder which I found out that did the work behind EXT_TROUPEWITH and EXT_TROUPE (used for Heal Rain)

Changed from this:
Hey There!
Please login and(or) register to see this awesome content today.

Changed to this:
Hey There!
Please login and(or) register to see this awesome content today.

There for I manage to get my plan to work. It works as targeted without being in a party and as around inside the party, but (always a but)...

There is a problem in which even if I'm FAR away from the members of my party (have to be in the same world and layer) the buffs still works, like, my RM is in Flaris and my Blade is in Darkon and both of them get the buffs, I just wanted the around buff in party to work while the other member being in the range of the skill (same as if I would target it)

I'm using the L15 files, and here is the inside of the ApplySkillAroundTroupe which is called to buff all party members (I did not changed that and see that it does a calculation on fDist < fMaxDistSq)

Hey There!
Please login and(or) register to see this awesome content today.
 
Well, if I understood correctly, you are applying the skill to the target without validating anything.
I think you've already found the solution...
maybe changing
Hey There!
Please login and(or) register to see this awesome content today.

to :
Hey There!
Please login and(or) register to see this awesome content today.
 
If I understand correctly the part you mentioned is the one before calling the function ApplySkillAroundTroupe, which is working, I'm buffing the selected target as it should. The problem is inside this function when I loop through the members of the party and them check if they are alive, in same world, in the same layer... and if they are in the distance to be buff or not

The code for checking the distance from the member to me, to check if they should be buffed or not based on the distance (I guess this code below, which is inside the function ApplySkillAroundTroupe) is the one not working
Hey There!
Please login and(or) register to see this awesome content today.

Some things I tried:

I tried changing the values of fMaxDistSq to a fixed number instead of (code below), which I suppose gets it from the ranged defined in each skill on resource to check if this was not the problem, did not work

Hey There!
Please login and(or) register to see this awesome content today.

I also tried removing the line (below) which was multiplying the fMaxDistSq by itself and was causing the value to be tremendous high, like numbers elevated to 19, also did not work

Hey There!
Please login and(or) register to see this awesome content today.

I tried to debug to understand the values, I'm not even sure if I did it right, but the numbers in the end of fMaxDistSq was not even close to 2.0f which was defined inside the skill I was using, and the numbers from fDist was in the thousands, I guess this variable is the result of the distance between both RM and other party member, but it was not even close to 2.0f which was the distance I was checking (based on the max range of the skill)
 
Just a concept
Hey There!
Please login and(or) register to see this awesome content today.


Only issue is possible doublecasting with two instances of applyskill. So just verify target is not in party and you're all good, or if it already does self in ApplySkillAroundTroupe -- or whatever needs to be done.

Then i believe just targetingobj works cause you can self cast with it, or whatever dont remember.
 
Kia I'm not sure if I follow you right, but seems to me that this code you mentioned is for the targeting and self part (outside the function for party members), my problem is in the loop on the members of the party where I need to buff around (REGION or AROUND whatever) and it only should work if the distances from party members and the buffer are in skill range zone, it's working in distances FAR away from that

I tried to use the targetingobj in the resource which you mentioned but only worked for targets and not self (I don't know why), then I added an else in this function (targetingobj) to work to self if not selected a target and it worked, I can now buff someone targeting them or I can buff myself [Working]

My problem is when I'm buffing myself or targeting other party members (closes to me). The ones that are FAR away, like in Flaris to Darkon distance, are also receiving the buffs, It only should buff party members that are CLOSES to me, in the max range of the skill (like Flaris pang to Flaris deposit)


What I'm trying to do is to work in the five scenarios below and 3 of them are not working properly, the RED part is not working in these 3:
1 - Buff myself without being in a party and without targeting anyone -> [Working]
Expected result: buff to self

2 - Buff someone targeting them without being in a party with them -> [Working]
Expected result: buff to target (not in my party) + self

3 - Buff someone from my party targeting them -> [Partial Working]
Expected result: buff to target (party member) + self + every party member that is in the range of skill used (It is buffing EVERY members not checking distance)

4 - Buff myself being in a party and without targeting anyone ->[Partial Working]
Expected result: buff to self + every party member that is in the range of skill used (It is buffing EVERY members not checking distance)
5 - Buff someone targeting them without being in a party with them, but in a party with other people ->[Partial Working]
Expected result: buff to target (not from my party) + self + every party member that is in the range of skill used (It is buffing EVERY members not checking distance)

I guess the problem is inside the function
ApplySkillAroundTroupe, which loops the members and check their distance (not working the distance part)
 
Hey There!
Please login and(or) register to see this awesome content today.

Hey There!
Please login and(or) register to see this awesome content today.


Hey There!
Please login and(or) register to see this awesome content today.

It's possible that your values stored in pAddSkillProp->dwSkillRange is already really high, or a system has changed something else, and it's affecting that and debugging to see the results of your calulation and positions.
 
Last edited:
  • Like
Reactions: Skalleey
Solution
Hey There!
Please login and(or) register to see this awesome content today.

Hey There!
Please login and(or) register to see this awesome content today.


Hey There!
Please login and(or) register to see this awesome content today.

It's possible that your values stored in pAddSkillProp->dwSkillRange is already really high, or a system has changed something else, and it's affecting that and debugging to see the results of your calulation and positions.
Hi @Kia , Whenever I look at this line:
Hey There!
Please login and(or) register to see this awesome content today.

Something seems a bit off to me, both in your answer and in the initial modification posted in the first post of this topic. Wouldn't it be necessary to perform a distance validation before invoking this code? If not, why does "pMember->ApplySkill..." need to validate, and the "pTarget->ApplySkill..." alone doesn't?

Thank you in advance.
 
Kia, reading your solution it got me thinking what I was doing wrong, I did not tested your solution because after reading it, I managed to get mine to work after some modifications ( I probably can make a guide after on how I did it, so other can benefit aswell)

From reading your answer in this part got me thinking:

"It's possible that your values stored in pAddSkillProp->dwSkillRange is already really high, or a system has changed something else, and it's affecting that and debugging to see the results of your calulation and positions."
It called my attention to something I debug earlier, the value of dwSkillRange, I found out why it was getting a high value, in Resource this parameter is not being used, it receives '=' or '0', and the parameter of AR_SHORT, AR_RANGE is defined using dwAttackRange, I changed the max distance to get dwAttackRange now and not to dwSkillRange, and it started to get a normal number like 2.0f and not a ENORMOUS number as before, and I know now this number is related to the AR_SHORT, AR_RANGED, AR_FAR that I put on resource.
After that it also did not work yet, and I think it was because I had changed my code to not square the fMax value (fmax * fmax), I had removed the line multiplying the values to test hypotesis
😅 , but after that I had only to change the function of fDist from D3DXVec3LengthSq to D3DXVec3Length (I have no idea what both does, but it worked so going on) and it worked (why not put the line of fMax square back, IDK either, did not think straight at 4 AM) I had to ajust some other small things and WORKED fine,

I should change my code to something similar to yours, so I dont have the pTarget and pSrc (self) outside the ApplySkillAroundTrouple function, but since it is working fine, I'll let it for now

Your code and explanation helped a lot Thank You!


Hi @Kia , Whenever I look at this line:
Hey There!
Please login and(or) register to see this awesome content today.

Something seems a bit off to me, both in your answer and in the initial modification posted in the first post of this topic. Wouldn't it be necessary to perform a distance validation before invoking this code? If not, why does "pMember->ApplySkill..." need to validate, and the "pTarget->ApplySkill..." alone doesn't?

Thank you in advance.
I might not be the best one trying to explain it, but after trying hard to understand what was going on to fix my code, I can tell that ApplySkill applys the buff to the designated object, like how other buffs works, when using to pTarget, it applies to target, when I'm the object (calling the function direct) it applys to self.

With that in mind, in the function of ApplySkillAroundTrouple it loops through all members of the party, but we only want to apply the buff to the ones closes to the buffer, thats why to apply the ApplySkill to pMembers you have to check their distance before applying the buff, when you are applying to the target, you have "already" checked the distance from the buffer to the target, because you are applying to the selected target which is in your sight (you had to click on him) so the skill will apply like normal, the character will move towards the target if is too far from the skill range, or just buff if in range

The difference from the pMembers are that we are not targeting them at all, we are applying the buffs to everyone inside the party, targeting someone elses or not targeting anyone, just applying the skill, that why we need to check the distance before, so It would not happen what my initial problem was, applying buffs to all members not caring about their distance to the buffer like one being in Flaris and other in Darkon
 
Hi @Kia , Whenever I look at this line:
Hey There!
Please login and(or) register to see this awesome content today.

Something seems a bit off to me, both in your answer and in the initial modification posted in the first post of this topic. Wouldn't it be necessary to perform a distance validation before invoking this code? If not, why does "pMember->ApplySkill..." need to validate, and the "pTarget->ApplySkill..." alone doesn't?

Thank you in advance.

As mentioned, WUI_TARGETINGOBJ or whatever is used should verify the target's position on the cast of the skill -- and on the use of the skill beforehand -- but, that can always be looked in to see if it is hackable or possible to target from afar to verify.

Kia, reading your solution it got me thinking what I was doing wrong, I did not tested your solution because after reading it, I managed to get mine to work after some modifications ( I probably can make a guide after on how I did it, so other can benefit aswell)

From reading your answer in this part got me thinking:

"It's possible that your values stored in pAddSkillProp->dwSkillRange is already really high, or a system has changed something else, and it's affecting that and debugging to see the results of your calulation and positions."
It called my attention to something I debug earlier, the value of dwSkillRange, I found out why it was getting a high value, in Resource this parameter is not being used, it receives '=' or '0', and the parameter of AR_SHORT, AR_RANGE is defined using dwAttackRange, I changed the max distance to get dwAttackRange now and not to dwSkillRange, and it started to get a normal number like 2.0f and not a ENORMOUS number as before, and I know now this number is related to the AR_SHORT, AR_RANGED, AR_FAR that I put on resource.
After that it also did not work yet, and I think it was because I had changed my code to not square the fMax value (fmax * fmax), I had removed the line multiplying the values to test hypotesis
😅 , but after that I had only to change the function of fDist from D3DXVec3LengthSq to D3DXVec3Length (I have no idea what both does, but it worked so going on) and it worked (why not put the line of fMax square back, IDK either, did not think straight at 4 AM) I had to ajust some other small things and WORKED fine,

I should change my code to something similar to yours, so I dont have the pTarget and pSrc (self) outside the ApplySkillAroundTrouple function, but since it is working fine, I'll let it for now

Your code and explanation helped a lot Thank You!



I might not be the best one trying to explain it, but after trying hard to understand what was going on to fix my code, I can tell that ApplySkill applys the buff to the designated object, like how other buffs works, when using to pTarget, it applies to target, when I'm the object (calling the function direct) it applys to self.

With that in mind, in the function of ApplySkillAroundTrouple it loops through all members of the party, but we only want to apply the buff to the ones closes to the buffer, thats why to apply the ApplySkill to pMembers you have to check their distance before applying the buff, when you are applying to the target, you have "already" checked the distance from the buffer to the target, because you are applying to the selected target which is in your sight (you had to click on him) so the skill will apply like normal, the character will move towards the target if is too far from the skill range, or just buff if in range

The difference from the pMembers are that we are not targeting them at all, we are applying the buffs to everyone inside the party, targeting someone elses or not targeting anyone, just applying the skill, that why we need to check the distance before, so It would not happen what my initial problem was, applying buffs to all members not caring about their distance to the buffer like one being in Flaris and other in Darkon

1. D3DXVec3LengthSq to D3DXVec3Length - It's a difference between squares and then preforming sqrt.
Hey There!
Please login and(or) register to see this awesome content today.

vs

Hey There!
Please login and(or) register to see this awesome content today.
- The reason why the first is used is because doing one more exponential equation is faster than a sqrt one normally but both are valid approaches

2. You could do a mix of GetAttackRange(), Like GetSkillAttackDistance() and then return GetAttackRange() if dwSkillRange is either 0 or = (NULL_ID / UINT_MAX) -- this way, it keeps the original party skills the same (GT And Healrain will have dwSkillRange set or should then).
 
  • Like
Reactions: Skalleey
Status
Not open for further replies.