recently I saw on a server a guild war system where it makes you choose how many members to be like 5v5 and up to how many points, do you have any idea if it is on the net or if I can buy it from somewhere?
Solved, thanks to VegaS for their help.
If anyone ever wants to do something similar, they could use something like this:
for (int i = 0; i < 30; ++i)
if (dwEff == i)
m_swordRefineEffectRight = EFFECT_REFINED + 110 + (dwEff * 4);
The code is adequate to what I have, so you should change the number 110 and * 4 depending on what you want to do
Many thanks to the two people who responded, special thanks to Vegas.
Then you'll need a small formula like this, for keeping the same values of enum:
static const auto EFFECT_REFINED_SWORD_START = 110;
m_swordRefineEffectRight = EFFECT_REFINED + EFFECT_REFINED_SWORD_START + (dwEff * 4);
So, in that way, you'll get the effect value multiplied by 4 depending on effectID.
dwEff = 1
m_swordRefineEffectRight = EFFECT_REFINED + 114
dwEff = 5
m_swordRefineEffectRight = EFFECT_REFINED + 130
dwEff = 12
m_swordRefineEffectRight = EFFECT_REFINED + 158
I currently have them like this:
EFFECT_SMALLSWORD_EFF1, //dagger, fan, bell
EFFECT_SMALLSWORD_EFF1_LEFT, //dagger, fan, bell
EFFECT_SWORD_EFF1, // sword, two hand
EFFECT_SMALLSWORD_EFF2, //dagger, fan, bell
EFFECT_SMALLSWORD_EFF2_LEFT, //dagger, fan, bell
EFFECT_SWORD_EFF2, // sword, two hand
EFFECT_SMALLSWORD_EFF3, //dagger, fan, bell
EFFECT_SMALLSWORD_EFF3_LEFT, //dagger, fan, bell
Thanks for answering.
What I am trying to do is replace this:
if (dwEff == 1)
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SWORD_EFF1;
else if (dwEff == 2)
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SWORD_EFF2;
else if (dwEff == 3)
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SWORD_EFF3;
else if (dwEff == 4)
m_swordRefineEffectRight = EFFECT_REFINED+EFFECT_SWORD_EFF4;
else if (dwEff == 5)
We should probably see the rest of the code, but the compiler is telling you that with a reason. You cannot convert an array of chars to a numerical type. A solution would be setting m_swordRefineEffectRight = dwEff but then again, I am not really sure what you are trying to accomplish here.
It's impossible what you're trying to do, this could be done in python very easily, like:
m_swordRefineEffectRight = eval("EFFECT_REFINED + EFFECT_SWORD_EFF_%d" % i);
But in C++ there's no built-in method, just a work-around, and shitty ways.
I don't know how it's working your system but in your case, you need something very simple, not to evaluate an expression when you can use effectSwordStartID + effectID:
m_swordRefineEffectRight = EFFECT_REFINED + EFFECT_SWORD_EFF_START + dwEff;
You just need to have the values ordered ascendingly.
Hello, I am trying to do the following:
for (int i = 0; i < 30; ++i)
if (dwEff== i)
sprintf(szEff, "EFFECT_REFINED+EFFECT_SWORD_EFF%d", i);
m_swordRefineEffectRight = szEff;
But when I compile I get the error that it couldn't convert char to uint32_t.
How could I make this possible? Thank you