• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

From 0 to 499 in quest missonstate ids

watkins577

As3, lua, xml scripter
Joined
Sep 20, 2008
Messages
130
Reaction score
0
How do I do this, if I use 0 it doesnt do anything other than 0 (and 500 because I use 500 for complete). So I need something like <missionstate id="1..499" .../> or something like that..

Thanks
 
:eek: according to this then it wont do 0
Code:
if(readXMLInteger(p, "id", intValue) && id > 0)
	{
		id = intValue;
		if(id > m_lastId)
			m_lastId = id;
	}

Im guessing I have to do something there...

Ok I was close... Its this instead...
Code:
if(readXMLInteger(stateNode, "id", intValue))
					missionId = intValue;
				else
				{
					std::cout << "[Warning - Quests::parseQuestNode] Missing missionId for mission state" << std::endl;
					stateNode = stateNode->next;
					continue;
				}
 
Last edited:
Solved! Changed...
Code:
uint32_t missionId;
if(readXMLInteger(stateNode, "id", intValue))
        missionId = intValue;

to

Code:
uint32_t missionId;
uint32_t toId;
if(readXMLInteger(stateNode, "id", intValue))
{
	missionId = intValue;
        if(readXMLInteger(stateNode, "toid", intValue1))
        {
        	toId = intValue1;
        }
        else
        {
                toId = intValue;
        }
}
(In quests.cpp)

Which checks for toid in the quests xml file, and then runs a for loop which then adds all the new missionstate.

Heres the complete new code...
Code:
uint32_t missionId;
uint32_t toId;
if(readXMLInteger(stateNode, "id", intValue))
        {
	missionId = intValue;
        if(readXMLInteger(stateNode, "toid", intValue1))
        {
              toId = intValue1;
        }
        else
        {
              toId = intValue;
        }
}
else
{
	std::cout << "[Warning - Quests::parseQuestNode] Missing missionId for mission state" << std::endl;
	stateNode = stateNode->next;
	continue;
}

std::string description;
if(readXMLString(stateNode, "description", strValue))
	description = strValue;

for (int i = missionId; i <= toId; i++) {
        std::string newdes = description;
        if(description.find("|ID|") != std::string::npos) {
               std::stringstream stm;
               stm << i;
               replaceString(newdes, "|ID|", stm.str());
        }
	mission->newState(i, newdes);
}

Also you need to put uint32_t intValue1; At the beginning of it (Search for uint32_t intValue; and then just add it below it)
 
Last edited:
lol woulda just saved you guys some trouble if I seen this earlier, I'm not sure about the public release but in private svn just put |STORAGE| and it displays the value of the storage key.
 
Back
Top Bottom