Outpost Universe Forums

Projects & Development => Outpost 2 Programming & Development => Topic started by: Mcshay on March 03, 2006, 05:21:59 PM

Title: Using Hastechnology()
Post 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.
Title: Using Hastechnology()
Post by: Eddy-B on March 05, 2006, 10:56:30 AM
?
Title: Using Hastechnology()
Post by: Mcshay on March 05, 2006, 11:04:05 AM
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.
Title: Using Hastechnology()
Post by: Eddy-B on March 05, 2006, 12:56:06 PM
errrrrr..   "?"


[EDIT]
Player[0].HasTechnology(techMicrowave)  <- should work
Title: Using Hastechnology()
Post by: Mcshay on March 05, 2006, 01:22:30 PM
Oh, I was putting in the numbers.
Title: Using Hastechnology()
Post by: BlackBox on March 05, 2006, 03:44:22 PM
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).
Title: Using Hastechnology()
Post by: Mcshay on March 05, 2006, 03:46:20 PM
Thanks, that fixed it.