Author Topic: Resources  (Read 1931 times)

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
Resources
« on: April 29, 2005, 05:26:55 PM »
Starting Resources (from pie):

Easy-High Res
Common - 6000
Food - 3000
Workers - 27
Scientists - 18
Children - 22

Normal-Med Res
Common - 4000
Food - 2000
Workers - 24
Scientists - 15
Children - 20

Hard-Low Res
Common - 2000
Food - 1000
Workers - 20
Scientists - 12
Children - 18



Attachment removed, scroll down and copy code.
« Last Edit: April 30, 2005, 08:45:40 AM by Leviathan »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Resources
« Reply #1 on: April 30, 2005, 12:38:20 AM »
Hmm. I would caution changing anything in the OP2Helper folder or Outpost2DLL folder yourself. This creates compatibility issues with future versions of the SDK or with other people you might want to send your code to.

If you want to make changes or extensions to things in those files, feel free to copy code to your own files and make changes there. The idea of those two folders is a bunch of code that many levels can all rely on. If everyone makes their own specific changes or level specific changes, it kinda defeats the purpose of having it shared like it is.

Also, I can see the use of what you've listed here. I'd certainly consider something like this for inclusion in a future SDK version. Heck, I was even thinking of doing something like that for the last one but it was already taking much longer to release than I wanted it to. But yeah, thanks for doing it. I was thinking of having a few different player initialization functions. The original values I had were based off of Colony, Eden Starship, but multiplayer has quite different values. I was thinking of add/renaming functions so there would be seperate InitMultiPlayerResources/InitColonyPlayerResources, or something like that. Unfortunately I didn't have those values you listed handy and promptly forgot about the idea.  :blush:
 

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Resources
« Reply #2 on: April 30, 2005, 08:45:06 AM »
Ok this is a bit stupid!

You must have a different SDK folder for each mission then. Because each mission you will want to have custom res startup, and that is not set in the mission folder.


Code for Pie:
Code: [Select]
	case 0:  // Easy
  player.SetOre(6000);
  player.SetFoodStored(3000);
  player.SetWorkers(27);
  player.SetScientists(18);
  player.SetKids(22);
  break;
case 1:  // Normal
  player.SetOre(4000);
  player.SetFoodStored(2000);
  player.SetWorkers(24);
  player.SetScientists(15);
  player.SetKids(20);
  break;
case 2:  // Hard
  player.SetOre(2000);
  player.SetFoodStored(1000);
  player.SetWorkers(20);
  player.SetScientists(12);
  player.SetKids(18);
}

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
Resources
« Reply #3 on: April 30, 2005, 12:21:20 PM »
For each multi i wound not want different resources. You do not need seperate sdks for each missions. like hoo said, the code in there is universal. Any mulit/mission/colony without resources defined will have the ones in OP2Helper.cpp. Pie has a fair set of resources. It seemed logical to me to change it in there. You your self asked me to up the resources to pie on my new map. It seemed logical to update that so i don't have to screw with it in the future.

btw levi ur code is incomplete

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
Resources
« Reply #4 on: April 30, 2005, 02:04:42 PM »
i didnt copy the whole file because it dosent need to be

yes but all missions wont use the same setup.

how do u setup res in ur mission then? i didnt no u could?

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Resources
« Reply #5 on: April 30, 2005, 07:27:57 PM »
You can just copy and paste that one function into Main.cpp and then change the name. Then just use your new function with any edited values you want. Or you can just do everything yourself manually by the direct calls you see in that function.

Anyways, I wanted to have some sort of resource startup that was easy to set for quick testing. Early on, I found myself constantly setting resources to some arbitrary nonzero value and it speeded up testing to have a function to do it for me in one line. I figured values based on an actual DLL would be decent starting values. I just used a colony game instead of a multiplayer game like pie. The multiplayer settings are probably more useful though, so they'll likely be added in a future version.

Until then, if you have custom resource setup requirements, you should do it in Main.cpp, not in the OP2Helper files. If you don't adhere to this, then yeah, you'll need a seperate SDK installation for every level, which is kinda ridiculous.


Hmm, does anyone think there should be an extra structure added for use in BaseData.h to specify starting resources for each base layout or location? And if so, at what level (what structure) should include this info?