Outpost Universe Forums
Projects & Development => Outpost 2 Programming & Development => Topic started by: Mcshay on March 03, 2006, 05:21:59 PM
-
I've been trying to create some code that does something if a player has researched rare ore, and something else if the player hasn't. I can't get HasTechnology() to work for me. Could someone post and example of it working?
Edit: I figured it out, I was getting the tech from the .txt file, not the header. The numbers in the .txt have an extra 0 in the front.
-
?
-
When I was looking for the tech to use with that function, I didn't know there was a header with them defined. I was opening the tech file and looking in there. They are listed differently in the tech file.
-
errrrrr.. "?"
[EDIT]
Player[0].HasTechnology(techMicrowave) <- should work
-
Oh, I was putting in the numbers.
-
You can still put the numbers, just be sure that you don't put any 0's before the tech ID.
That is, if the techfile says 00210 as a research ID, get rid of the leading zeros.
(In C++, any number prefixed with 0 is an octal (base 8) number. Tech IDs are decimal (base 10) however).
-
Thanks, that fixed it.