Hi Chain or any other hero,
can someone fix one little thing in the Nraas Vector code for me, or do I have to learn how to import gitprojects into MonoDevelop? (Please don't make me do that, I want to fuddle around with things that influence the game directly in my sparse time right now)
The GetNextStage function in NRaas.VectorSpace.Stages.WeightedStage throw an Array out of bounds error.
This:
int result = RandomUtil.GetInt(mTotalWeight);
needs to either be
int result = RandomUtil.GetInt(mTotalWeight-1);
or
if (current > result) break;
needs to be
if (current => result) break;
Pretty pleeeeeease?
Snow
To Chain_Reaction or anyone else who can handle the code
- KittyTheSnowCat
- Reactions:
- Posts: 647
- Joined: October 1st, 2015, 6:00 pm
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7568
- Joined: December 30th, 2011, 6:00 pm
- Contact:
To Chain_Reaction or anyone else who can handle the code
So I'm not super clued on on Vector as I've done very little work with it but I haven't seen anyone else with the issue. Why is it breaking for you? Are you making your own disease?
- KittyTheSnowCat
- Reactions:
- Posts: 647
- Joined: October 1st, 2015, 6:00 pm
To Chain_Reaction or anyone else who can handle the code
Noone else has this issue because in the diseases available here, WeightedStage isn't used. Yes I am making my own disease or rather changing the Common Cold for now. I want the herbs from university to be more useful and less cheaty. so I am repurposing them as medicine.
Basically the broken function takes a random number from 0 to the number of next stages and then goes through them.. in a loop. Packs the next stages into an array. But Since array indexes start at zero whenever it picks the highest number it is out of bounds. Noone ever notices because there are no diseases yet that use that Stageclass.
Basically the broken function takes a random number from 0 to the number of next stages and then goes through them.. in a loop. Packs the next stages into an array. But Since array indexes start at zero whenever it picks the highest number it is out of bounds. Noone ever notices because there are no diseases yet that use that Stageclass.
- KittyTheSnowCat
- Reactions:
- Posts: 647
- Joined: October 1st, 2015, 6:00 pm
To Chain_Reaction or anyone else who can handle the code
Just to be clear. I am looking for someone who has the whole development environment set up and can therefore quickly correct this and compile. In that case since I already wrote down the two options to fix this that should not take a lot of effort.. If noone has a fast way to do it I will do it myself.
- KittyTheSnowCat
- Reactions:
- Posts: 647
- Joined: October 1st, 2015, 6:00 pm
To Chain_Reaction or anyone else who can handle the code
Hmm no idea why I remembered that as super difficult.. I just nḱnow I never got Nraas projects to compile with Visual Studio..
I just compiled a corrected Version of Vector though.
I just compiled a corrected Version of Vector though.
- Chain_Reaction
- Site Admin
- Reactions:
- Posts: 7568
- Joined: December 30th, 2011, 6:00 pm
- Contact:
To Chain_Reaction or anyone else who can handle the code
I was going to but glad you got it sorted.
- KittyTheSnowCat
- Reactions:
- Posts: 647
- Joined: October 1st, 2015, 6:00 pm
To Chain_Reaction or anyone else who can handle the code
Well I was just trying it again to remember what the problem was when I tried it years ago on Windows + Visual Studio. I only remember it not working..
But on Linux + MonoDevelop all I had to do is relink some dependencies.
Maybe I was too stupid some years ago, maybe there was a bug, long story short, I can play around with the NRaas code now (and this is where you should scream out in terror^^)
My disease works beatifully now without error messages now, I just have to rebalance the resistances a bit.
But on Linux + MonoDevelop all I had to do is relink some dependencies.
Maybe I was too stupid some years ago, maybe there was a bug, long story short, I can play around with the NRaas code now (and this is where you should scream out in terror^^)
My disease works beatifully now without error messages now, I just have to rebalance the resistances a bit.