Author Topic: OP2 SDK Updated  (Read 2443 times)

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
OP2 SDK Updated
« on: February 27, 2005, 05:45:57 PM »
In case you didn't already know, we're on the way to finishing mission SDK 2.

We're really close to finishing it, and will probably release it sometime after that.

The new SDK will include new enums and values of commonly used things, and more sample/starter code for you to use in making your own missions.

The Header will also be split up into different files which makes it easier to quickly look up functions or enums you might use.

Watch this thread for more updates.

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
OP2 SDK Updated
« Reply #1 on: March 07, 2005, 05:12:40 PM »
SDK version 2 is finally here.

The ZIP file has been updated, so you can download it at the same location as before.
(which is http://www.outpostuniverse.net/files/op2_dllsdk.zip}

Many changes have been made. To see what they all are have a look at ReadMe.txt inside the ZIP file.
« Last Edit: March 23, 2005, 04:59:35 PM by op2hacker »

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
OP2 SDK Updated
« Reply #2 on: March 07, 2005, 06:10:05 PM »
Great!! Time to get back to programing!
Enjoy everyone :)
We hope it makes it easyer for people to get to grips for programing for Outpost 2.

Offline plymoth45

  • Hero Member
  • *****
  • Posts: 1062
OP2 SDK Updated
« Reply #3 on: March 07, 2005, 09:03:27 PM »
Will help me out a bit :)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
OP2 SDK Updated
« Reply #4 on: March 08, 2005, 06:34:07 PM »
I'm hoping the SDK will be easy to use even for non-programmers. I figure someday soon we'll get a tutorial up to walk people through compiling and editing the starter project. It'll probably be the kind of thing for people who have never used a compiler before. At least the initial part. Probably have it build a little in progressive levels so people with some programming experience will have something to read and won't feel their intelligence is being insulted.  :P  

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
OP2 SDK Updated
« Reply #5 on: March 09, 2005, 04:38:58 AM »
Yea I think a programming tutorial  would be good for the new site.

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
OP2 SDK Updated
« Reply #6 on: March 09, 2005, 03:29:25 PM »
All looks great.
I guess i didn't submit my data on the SpecialTarget functions, since it's still missing  :blush:  Other then that - i think it pretty much covers all our findings.

As for the "programming tutorial" Leviathan refers to, i think it would be a good idea, but keep in mind this will undoubtedly create many questions from people who never programmed before... so i hope you guys (uhm... i guess that includes me) are up for some hard time helping out coding-noobs  :rolleyes:

I still have some remarks to the headers... I'll drop a PM to Hacker


>> i think i need to get Renegades going again (it'll need some editing to compile with the new naming conventions and all)
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Leviathan

  • Hero Member
  • *****
  • Posts: 4055
OP2 SDK Updated
« Reply #7 on: May 07, 2005, 11:03:56 PM »
for update, we should include all the new maps source code.
zighoovile
nostal
etd
punwick

and edit:
hoovile map to use opu_03.map

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
OP2 SDK Updated
« Reply #8 on: May 08, 2005, 12:07:34 AM »
imo we should ditch the new names

zighooville has several funcs that need to be integrated into the sdk itself


In ZigHooville:

<in funcs.cpp>
The starting units setup
  • void PutInitUnits(int x, int y, int i)
Morale
  • void SetupMorale()
D/N
  • void SetupDayNight()
Volcano animation funcs
  • void SouthEastFlowAni ( int x, int y)
  • void SouthFlowAni( int x, int y)
  • void SouthWestFlowAni ( int x, int y)
  • void SouthEastFlowStopAni ( int x, int y)
  • void SouthFlowStopAni( int x, int y)
  • void SouthWestFlowStopAni ( int x, int y)
Set all black tiles-border tiles as lava positive
  • void SetAllLava()
Pie Resources
  • InitPlayerResourcesToPie()
Func to see if the tile is passible (natural reasons)
  • IsPassible( int x, int y)
also, zighooville has a new feature that allows cargo trucks cargo to be set. it requires a bit of modification to the sdk and would be best kept as a seperate struct for backwards compatibiltity, but put into any new code bases.
syntax:
struct VehicleInfoE unitSetx[] =
{  x relative to cc,  y relative to cc , vech type, cargo (for convecs), direction ,cargo (for cargo trucks) , amount of cargo (for cargo trucks)},etc



not all the new maps tho. i don't want to release borehole or any of its varients atm.



zighooville has a mini-c++ tutorial in it and synatax for disators and a example for use of SetTimeTrigger


imo punwick or whatever punboy's working on needs a bit of work and debugging before release as part of the sdk
« Last Edit: May 08, 2005, 12:30:10 AM by zigzagjoe »

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
OP2 SDK Updated
« Reply #9 on: May 08, 2005, 04:23:17 PM »
I've updated the code to Hooville slightly. It now includes structure kits in the structure factories. It does this using enums to find the structure factories, and then uses the returned Unit object to add structure kits to it. This requires no changes to existing code in the OP2Helper folder and is a fairly clean way of doing it. This is probably the method I would recommend if you're already using the OP2Helper files (which most of you probably are).


The changes are placed in InitProc. I included a few lines after the new code (with updated comments), so you should be able to see where this code goes based on that. Basically, after the base creation (so the Structure Factories exist and can be found by the enumerators).





Code: [Select]
	// Note: Here we will demonstrate a use of enums to find the Structure Factories
//  created for each player and give them some initially stored structures.
// Note: Enumerators can be used to traverse a list of all units of a certain type
//  but in this context, we only want the first one returned. Normally you would
//  keep calling GetNext in a loop to retrieve subsequent units matching the
//  search criteria for the enumerator.

Unit building; // Unit object to hold the reference to the Structure Factory

for (i = 0; i < TethysGame::NoPlayers(); i++)
{
  // Create an enumerator for this player's structure factories
  PlayerBuildingEnum buildingEnum(i, mapStructureFactory);

  // We only want the first one found (if any at all)
  if (buildingEnum.GetNext(building))
  {
   // We have successfully retrieved a handle to a structure factory in "building"
   // Give the first 4 structure kits unconditionally
   building.SetFactoryCargo(0, mapUniversity, mapNone);
   building.SetFactoryCargo(1, mapNursery, mapNone);
   building.SetFactoryCargo(2, mapTokamak, mapNone);
   building.SetFactoryCargo(3, mapRobotCommand, mapNone);
   // Only give the next structure kit on Med or High resources
   if (Player[i].Difficulty() <= 1)
    building.SetFactoryCargo(4, mapCommonOreSmelter, mapNone);
   // Only give the last structure kit on High resources
   if (Player[i].Difficulty() == 0)
   building.SetFactoryCargo(5, mapVehicleFactory, mapNone);
  }
}




// Misc initialization


// Create some Tiger Speed Modifciation wreckage! =)
TethysGame::CreateWreck(95, 63, (map_id)11999, 0); // Tech #11999 - tiger speed upgrade

// Set a default starting morale level
TethysGame::ForceMoraleGood(-1);
// Enable morale to float if they've selected it from the game setup dialog box
if (TethysGame::UsesMorale())
  TethysGame::FreeMoraleLevel(-1);
// Enable day and night if it's been selected from the game setup dialog box
TethysGame::SetDaylightEverywhere(TethysGame::UsesDayNight() == 0);
// Disable movement of Day and Night!
// Note: You normally don't want to do this. What this does is makes the map
//  eternally dark if day and night is enabled (dependent on the SetInitialLightLevel
//  as well). This of course has no effect if day and night are disabled.
TethysGame::SetDaylightMoves(0);
GameMap::SetInitialLightLevel(-32);


// Setup a victory condition
// (Just use a helper function for a common victory condition)
CreateLastOneStandingVictoryCondition();