One Minute Game Review by The Happy Friar:
Also on Rumble:

idTech 4 (aka Doom 3 tech) Discord Server!

Main Menu

ROE compiling error

Started by VGames, April 02, 2016, 02:13:15 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Ok I'm trying to compile the ROE source and I'm getting an error that has to do with conflicting event types. In Doom 3 it works fine but ROE needs the event to be a different type.

Here's the error:

3>.\d3xp\AFEntity.cpp(3539) : error C2440: 'initializing' : cannot convert from 'int' to 'idStr'
3>        Constructor for class 'idStr' is declared 'explicit'

It's referring to this section of code that has to do with harvesting souls with the Bloodstone:

if(requiredWeapons.Length() > 0) {
idStr playerWeap = thePlayer->GetCurrentWeapon();
if(playerWeap.Length() == 0 || requiredWeapons.Find(playerWeap, false) == -1) {
okToGive = false;

It needs the GetCurrentWeapon event to be an idStr type but I have it set up like this in Player.h for many different reasons:

int GetCurrentWeapon( void ) { return currentWeapon; };

Here's what it was originally set up as in the ROE source:

idStr GetCurrentWeapon();

Any ideas how to work around this? Commenting this section of code in AFEntity.cpp allows a full compile but in game crashes will occur if a harvet body is nearby and your not using the Bloodstone. You get an error that says function "Charge" is not in the script of whatever weapon you're currently using that's not the Bloodstone.
Get the latest on Perfected Doom 3 here -


Why did you change the return type from idStr to int? You either are going to have to revert back to idStr or refactor all code that calls GetCurrentWeapon()


Sikkmod did this for version 1.2. Since Sikkpin never made a version 1.2 for ROE he never addressed this issue. But I fixed it. I changed the bit of code in AFEntity.cpp to this:

if(requiredWeapons.Length() > 0) {
int playerWeap = thePlayer->GetCurrentWeapon();
if(playerWeap != 12) {
okToGive = false;

Worked like a charm. I had the same bad thoughts you had running through my head but then I figured out a much simpler method. Hope this helps somebody.
Get the latest on Perfected Doom 3 here -