Hi ragezoners,
I am working on an system but i am stuck atm.
What i am trying to do is to get Random Mover Id's
So it needs to randomly select and ID from MoverProp
currently i have this
first its looping true all the movers then it only outputs the movers who has the class RANK_LOWCode:for (int i = 0; i < prj.m_nMoverPropSize; i++) { MoverProp* pMoverProp = prj.m_pPropMover + i; switch(pMoverProp->dwClass) { case RANK_LOW: OUTPUTDEBUGSTRING("\n LowRank Mobs: %d", pMoverProp->dwID); break; } }
so as an example i have this
20
25
112
200
210
so far its good.
What i now need is this
I want to have 5 movers created with an Random id.
so i thought well i do this
however it wont work since the output is thisCode:for(int i = 0; i <= 5; i++) { int nRandMover = rand() % pMoverProp->dwID; }
Rand between 0 and 20 will output example 2
But there is no MoverID with number 2. So it will give me an error.
Do i need to put them into an array and then loop true it? or is it something else i am not seeing at this moment?
With kind regards





