Author Topic: How to setup Op2 Sdk With VS 2015 + Project Templates?  (Read 10460 times)

Offline dave_erald

  • Sr. Member
  • ****
  • Posts: 262
Re: How to setup Op2 Sdk With VS 2015 + Project Templates?
« Reply #25 on: January 02, 2016, 10:22:05 AM »
If I run the SDK, as is, in full release it gets hung up on this:

Code: [Select]
void CreateStarshipVictoryCondition()
{
Trigger trig;

// Create victory conditions for - Colony, Starship
trig = CreateCountTrigger(1, 1, -1, mapEvacuationModule, mapAny, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 1, trig, "Evacuate 200 colonists to spacecraft");
trig = CreateCountTrigger(1, 1, -1, mapFoodCargo, mapAny, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 1, trig, "Evacuate 10000 units of food to spacecraft");
trig = CreateCountTrigger(1, 1, -1, mapCommonMetalsCargo, mapAny, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 1, trig, "Evacuate 10000 units of Commom Metals to spacecraft");
trig = CreateCountTrigger(1, 1, -1, mapRareMetalsCargo, mapAny, 1, cmpGreaterEqual, "NoResponseToTrigger");
CreateVictoryCondition(1, 1, trig, "Evacuate 10000 units of Rare Metals to spacecraft");
}


// For use in multiplayer. Note: Computer controlled opponents do not count towards this.
// You win when there is only one human opponent left or all surviving human players are allied.
// This also creates corresponding failure conditions
void CreateLastOneStandingVictoryCondition()
{
Trigger& trig = CreateOnePlayerLeftTrigger(1, 1, "NoResponseToTrigger");
CreateVictoryCondition(1, 1, trig, "Eliminate your opponents.");
}


// Fail if the number of active Command Centers becomes equal to 0.
void CreateNoCommandCenterFailureCondition(int playerNum)
{
Trigger& trig = CreateOperationalTrigger(1, 1, playerNum, mapCommandCenter, 0, cmpEqual, "NoResponseToTrigger");
CreateFailureCondition(1, 1, trig, "");
}

...and it throws these errors

Code: [Select]
>OP2Helper.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function __unwindfunclet$?CreateLastOneStandingVictoryCondition@@YAXXZ$0
1>OP2Helper.obj : error LNK2019: unresolved external symbol __EH_epilog3 referenced in function "void __cdecl CreateLastOneStandingVictoryCondition(void)" (?CreateLastOneStandingVictoryCondition@@YAXXZ)
1>OP2Helper.obj : error LNK2019: unresolved external symbol __EH_prolog3 referenced in function "void __cdecl CreateLastOneStandingVictoryCondition(void)" (?CreateLastOneStandingVictoryCondition@@YAXXZ)
1>OP2Helper.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __unwindfunclet$?CreateLastOneStandingVictoryCondition@@YAXXZ$0
1>.\Release\OP2Script.dll : fatal error LNK1120: 4 unresolved externals

Which is after in Visual Studio 2015 I set code generation to Multithreaded, and I set Linker advanced properties to Yes/NOENTRY point.
This is with the SDK 2.1 Release

It's just linking errors, if I cut it out it's fine. I think I just need to move it, or add an #include to something it can't find.

Thoughts?

EDIT: Changing the Linker Setting from No to Yes/NOENTRY point fixed this error:

Code: [Select]
1>LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12

Fix one, create another.
« Last Edit: January 02, 2016, 01:38:53 PM by dave_erald »
-David R.V.

-GMT400 fan
-OPU Influencer

Offline leeor_net

  • Administrator
  • Hero Member
  • *****
  • Posts: 2352
  • OPHD Lead Developer
    • LairWorks Entertainment
Re: How to setup Op2 Sdk With VS 2015 + Project Templates?
« Reply #26 on: January 02, 2016, 01:42:10 PM »
Agreed. It would also be helpful to have a mapper that was... I dunno... useful. No hard feelings toward whoever built what's currently available but it's just not intuitive and is very unfinished and unpolished.

I'm also thinking about something you had proposed awhile back, or at least I think you proposed it... building a DLL file that could be used to load a different breed of map file that defines things like starting points, AI scripts, etc. I'm not sure how the hooks would work to make it generic like that but something tells me it's doable. On top of that, you'd have the mapper offer a clean interface toward setting starting locations and AI personalities (aggressive, defensive, hybrid, etc.) and possibly scripted events... what comes to mind is StarCraft's mapper tool. Something along those lines.

But that is probably a rather big project which would require a good amount of thought and developer effort to pull off effectively.

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Re: How to setup Op2 Sdk With VS 2015 + Project Templates?
« Reply #27 on: January 02, 2016, 09:42:53 PM »
This needs to be looked into.

Designing a new level format, and editor to go along with it is a large task. I feel ultimately something like that is important if we really want people to start making new missions. The current way to too slow and too involved. Such a project won't happen overnight though, and with our track record might never be finished, so I feel the current SDK needs to be maintained. It's the only current way to build levels for Outpost 2, and will probably form a foundation for any future ways to build levels.

I'm a little embarrassed I haven't jumped on this earlier. I've only recently tried installing the copy of Visual Studio 2015 that I'd downloaded months ago. The install never seems to finish, probably due to heavy swapping while running a VM. I'll have to get this sorted.