#144937 - Shay - Fri Nov 09, 2007 3:42 pm
Hi all,
I have a very weird problem.
I have a method that get a value in an XML file :
With the values I have get, I instanciate a new Effect :
But this instanciation seems not to be effective.
Indeed, I print values :
The, the result is 0,-50.
Here is the Effect constructor :
With this, no way it works.
I tried to initialize fields in the ctor body and to iprintf the mpModif_ value. When I do that BETWEEN the "//**********" (see below), it works fine, and I got the good values (-50, -50). Otherwise, it doesnt work. I show you :
Thank you very much for your help I have to finish this game very soon !
I will keep looking here for the next days, please ask me details if you have any idea.
++
I have a very weird problem.
I have a method that get a value in an XML file :
Code: |
sscanf(xEffect.getChildNode("mpmodif").getAttribute("value"), "%d", &mpModif); |
With the values I have get, I instanciate a new Effect :
Code: |
Effect *test = new Effect(durationTime, probabilities, delay, target0, hpModif, mpModif, intModif, agiModif, strModif, defModif, mdefModif, aspdModif, msModif, msModifPer, atkModif, status); |
But this instanciation seems not to be effective.
Indeed, I print values :
Code: |
iprintf("\x1b[2;0H test : %d, %d\n", test->GetMpModif(), mpModif); |
The, the result is 0,-50.
Here is the Effect constructor :
Code: |
Effect::Effect(u16 durationTime, u8 probabilities, u8 delay, u8 target, int hpModif, int mpModif, int intModif, int agiModif, int strModif, int defModif, int mdefModif, int aspdModif, int msModif, int msModifPer, int atkModif, Status status) :
Start_(0), Stop_(0), Run_(0), durationTime_(durationTime), probabilities_(probabilities), delay_(delay), target_(target), hpModif_(hpModif), mpModif_(mpModif), intModif_(intModif), agiModif_(agiModif), strModif_(strModif), defModif_(defModif), mdefModif_(mdefModif), aspdModif_(aspdModif), msModif_(msModif), msModifPer_(msModifPer), atkModif_(atkModif), status_(status), lastTick_(0), started_(false) { [...] // No relationship with the subject } |
With this, no way it works.
I tried to initialize fields in the ctor body and to iprintf the mpModif_ value. When I do that BETWEEN the "//**********" (see below), it works fine, and I got the good values (-50, -50). Otherwise, it doesnt work. I show you :
Code: |
Effect::Effect(u16 durationTime, u8 probabilities, u8 delay, u8 target, int hpModif, int mpModif, int intModif, int agiModif, int strModif, int defModif, int mdefModif, int aspdModif, int msModif, int msModifPer, int atkModif, Status status)
{ //**************** Start_ = 0; Stop_ = 0; Run_ = 0; durationTime_ = durationTime; probabilities_ = probabilities; delay_ = delay; target_ = target; hpModif_ = hpModif; mpModif_ = mpModif; intModif_ = intModif; agiModif_ = agiModif; strModif_ = strModif; defModif_ = defModif; mdefModif_ = mdefModif; aspdModif_ = aspdModif; msModif_ = msModif; msModifPer_ = msModifPer; atkModif_ = atkModif; //**************** status_ = status; lastTick_ = 0; started_ = false; [...] // No relationship with the subject } |
Thank you very much for your help I have to finish this game very soon !
I will keep looking here for the next days, please ask me details if you have any idea.
++