Lethal Errors

I've bewen working on a new race.  Most of the coding is done, but I am currently stuck because of these errors:

Assert @ c:\projects\Perforce\SinsDiplomacy\main\CodeSource\GS/Entity/Interfaces/IAbility.cpp(279)

NeedsSingleTarget()

 

Assert @ c:\projects\Perforce\SinsDiplomacy\main\CodeSource\GS/Entity/Interfaces/IBuff.cpp(2344)

(instantAction.instantActionTriggerType == InstantActionTriggerType::AlwaysPerform) || (instantAction.instantActionTriggerType == InstantActionTriggerType::OnChance)

 

Assert @ c:\projects\Perforce\SinsDiplomacy\main\CodeSource\GS/Entity/Interfaces/IBuff.cpp(2344)

(instantAction.instantActionTriggerType == InstantActionTriggerType::AlwaysPerform) || (instantAction.instantActionTriggerType == InstantActionTriggerType::OnChance)

 

Assert @ c:\projects\Perforce\SinsDiplomacy\main\CodeSource\Engine/Archive/TextFileArchive.cpp(183)

*stringSrc == _T('"') 

 

Assert @ c:\projects\Perforce\SinsDiplomacy\main\CodeSource\Engine/DataStructures/DynamicVector.h(172)

i >= 0  

 

I'm guessing there is some sort of logical fallacy in my coding that the game engine is rejecting, but I can't think of what it is...

10,742 views 13 replies
Reply #1 Top

You seem to have a problem with some abilities and buffs, a string, and a mesh. No help from me.

Reply #2 Top

A, I think I know where the mesh error is coming from: I added weapons to a structure that didn't have them before.  As to the others, I can't say.  I'll have to check the files again.

Reply #3 Top

More errors:

Assert @ c:\projects\Perforce\SinsDiplomacy\main\CodeSource\GS/Entity/Interfaces/IAbility.cpp(289)

m_researchPrerequisites.HasSubject(m_baseSourceResearchSubject)

Reply #4 Top

For the "instantActionTrigger..." ones I guess you put in some invalid code for a buff. The way it looks you either wrote "OnChance" trigger type without giving a chance value, or you gave a chance value despite using the "AlwaysPerform" trigger. (Or something similar, just go through all your buffs and look at the instantActions and periodicActions)

The "researchPrerequisites..." one doesn't crash the game (at least for me it doesn't, and I'm getting 3 of them). I guess something is messed up with an ability research prerequisite/leveling setup. Maybe the game also wants you to set the baseSourceResearchSubject (from the leveling setup) as a research prereq for the ability. Edit: I tried it, that's the problem. Set level 1 of whatever is your baseSourceResearchSubject as a research prereq for the ability and the error stops appearing.

However I must say these errors are quite annoying, as they don't specify which file is causing the problem, despite doing so appears to be possible.

Reply #5 Top

The instantTriggers are for periodic buffs which can only have AlwaysPerform or OnChance. I am not sure about the ability one, could you post how it looks?

Reply #6 Top

Similar to this thread on kamikaze SC, are you trying to make a SC squad ability apply a buff to its members via an "ApplyBuffToSelf" action, other than ConvertFightersToMines? That could be causing the "needs single target" ability error, as the ApplyBuff fails to work on the squad members.

Or you could be using ApplyTargettedBuffToSelf, or one of the related Target references, with an AoE buff.

Reply #7 Top

I'm not trying to make a fighter ability buff (yet).  As to the "OnChance" thing, that is precisely what it is; I've fixed it.

Reply #8 Top

One more thing- I figured the best way to repay informatyion is with information, so here's something that might heelp you:

you know the "FkeetBeacon" ability?  Well, aside form spawning random ships (weighted for specific ships at will) it can also be used to always spawn up to TWO frigates in varying amounts (or specific amounts) by using this code:

spawnShips
 minFleetPoints 10.000000
 maxFleetPoints 10.000000
 requiredShipCount 2
 requiredShip
  type "FrigateMercRogueSquadronElf"
  minCount 2
  maxCount 2
 requiredShip
  type "FrigateMercGunshipElf"
  minCount 8
  maxCount 8
 randomShipCount 0

As you can see I'm trying to make a mercenary mod with the code, but it can easily be adapted to spawn any frigate you want- spawn a SB constructor frigate, spawn an ability only frigate (like the combat turrets) ar any combination you want.

Reply #9 Top

You can also do that with the "CreateFrigate" action, as used by the Sova Missile Platform and others.

The Fleet Beacon setup only is worth the code if you want to randomize the ships.

About the NeedsSingleTarget one, maybe you messed up some other target reference? Like I said earlier, maybe you're using ApplyBuffToTarget (or one of the NoFilter/NoRange variants) under the wrong conditions?

Reply #10 Top

Randomize is not the only reason as it can also spawn capital ships.

Reply #11 Top

It also is permanent; to my knowledge the "Create Frigate" spawn is temporary.  As to the cap. ship thing, I'm not sure how to do that.  Could you tell me?

Reply #12 Top

A thought I just had: If I rearranged the entity file entries would that do anything to narrow down the scope of the problem?  I assume that the game loads things in the same order as the manifest, but I could be wrong.  The main problem I have right now is that these errors are slowing down my debugging stomp, due to the fact that I cannot fix them at the moment and they always appear first, presumably because they appear in the files that load first.

Reply #13 Top

The game doesn't load stuff purely in the order of the manifest. StringNotFound errors for example only pop up the moment said string is displayed, while malfunctioning buffs aren't recognised as errors at all.

Invalid planet types only create errors when you load a map containing them.

Stuff like giving SC shields or phasing out a ship with an OnWeaponFired trigger instantly minidumps the game without producing any error message at all. (Shielded SC only minidump once they are attacked btw)

For simple entity errors, I suggest you deliberately bug a few files, then place one at the top of the manifest and one at the bottom. Note which one produces an error first, then switch the two and try again.