Found the issue: It's caused because those two entities have a potential max health of 0. It will crash when the game tries to mutate them since it always stores the original HP percentage (even if not used) before the mutation, which is calculated by current/max.
There really aren't any sanity checks on basic object data yet, which is letting things like this slip by. I'll require a minimum HP of 1 in the next build. For now you should just have to change those two to have a min HP of 1 and be good to go. (I tested it and nothing went wrong.)
And wow, it looks like you're adding a freaking selection menu into this mod--pretty unexpected and amazing.
Post by Aves Dominari on Aug 28, 2013 7:36:30 GMT -5
Hah! Of all the things to fuck up... they're dying when they spawn, that sounds like a problem indeed. Didn't mean to do that ;p
EDIT: Yeah, I tried to make it min/max one health, but a typo made it possible to have zero instead. How does the game handle a minimum stat value higher than the max, anyway?
The selection menu is probably the main selling point of the mod. I always got annoyed sorting through the same soldiers and making the same changes before actually playing (stop putting grenades in backpacks >:l), so I came up with a system that let me avoid that. It just grew from there.
If min is set higher than max, something will definitely break, eventually... There will be a block on that in the future, but I don't think there's anything preventing it in the data right now. (There really are very few checks at all, you can even set things negative and crash everything to hell if you like! The exception being the SA system, which has a massive number of checks to avoid all the potential mayhem. For now it's not too difficult to avoid screwing up the basic object data on your own, but we'll need all the checks eventually--I'm waiting until the data set is finalized.)
The only stat which *is* allowed to exceed maximum is TU, for effects like you see in Rookie's Tale where Haste spells and time manipulation can give you several turns worth of TU. That's okay, because TU is always reset to max at the beginning of every turn anyway. So setting min > max at the beginning of the game would be useless anyway--it's only used for effects.
Post by Aves Dominari on Aug 28, 2013 8:09:45 GMT -5
Hmm... that's interesting. The game treats entities with negative HP as stunned; even medi-kits can't wake them up. A race with noUnc true will act pretty much normally, though... shooting it will kill it instead of making it unkillable like I had hoped :c I'll stop trying to break the game and go back to modding. Thanks for the help ;p
Post by Aves Dominari on Aug 31, 2013 19:34:26 GMT -5
I seem to have run into another crash. In order to be absolutely sure my spawning data was right, I dropped a squaddie right outside of the building in question to check that everything was in place. Unfortunately, the game crashes whenever he walks through the front door. Removing the entities inside the room seems to fix the issue; perhaps it's related to the new display system? Other entities in other buildings don't seem to cause the crash... I set up some spawning for you. Squaddies are in front of safe doors; Sergeants are in front of crashing ones.
Hm, are attachments broken or something? Odd that it's not working all of a sudden.
(I want to move all X@COM stuff to a forum hosted on my own site, and make the forum more general purpose beyond just modding, but at the same time I don't want to associate X@COM too directly with my new company since it's part remake and I don't own the original IP. It'll have to wait until I re-brand the game completely.)
Checked out the test you sent me, and it's more or less the same problem as before, a division by 0 caused by a max attribute set to 0. This is being triggered by a reaction fire test when the soldier walks through the door and some entity has a max TU of 0 (max TU is the divisor in the reaction initiative formula).
So it's not a game issue, per se, it's just all those random entities you have on the map which haven't spawned yet. You need to make sure they're all spawned immediately when the map is created--there shouldn't be any left since they have strange stats that cause problems like this.
I'm not sure how your system is set up, but you could have also used temporary invisible props to spawn your entities. Is there a reason you didn't? And why are there any which remain unspawned after the game starts?
Post by Aves Dominari on Aug 31, 2013 21:33:34 GMT -5
Oh hell... I really hope you don't mind putting up with all my stupid mistakes, because I'm making a lot of them :s The way my system is set up allows the player to choose which alien race he fights against with the first control entity spawned on the map (with one of six special abilities, each of which will turn the placeholders into members of the actual races). After that, he goes on to spawn his squad, and before any player entities capable of exploring the map are actually in it all of the placeholder alien entities are replaced with the real ones. The reason there are a large number of unspawned ones is that I'm in the middle of implementing the alien spawning phase. Like I said, I ran into this crash making sure all the placeholder entities were where they were supposed to be; my run log isn't giving me any trouble, but that doesn't mean everything is in place per se. In the final version (and even my first public release) it will be impossible for a player to ever see these placeholder entities. I could use props, yes; I guess that would help avoid all of this crashy buggy business. It was just that I already used a large number of placeholder entities for squad selection, and it was the most direct way to implement placeholders for the aliens as well. If entities give me any more trouble my first instinct will be to dump the entity placeholders and replace them with props instead of bother you again, I swear :l
No problem at all, crazy/innovative ideas make things more interesting!
I figured that was what was happening here. You couldn't have reasonably known about the reactions issue. I believe I had an optional switch to turn it off before, called -noReactions, but I seem to have removed it at some point... Another way to test, without moving at all, is to just reveal (ctrl-k) the entire map, then teleport (ctrl-LMB) your test soldier to view whatever area you want, since teleporting then turning to look around won't trigger reaction fire even if in an enemy's FOV.
Using entities for this kind of spawning is probably not a good idea in general though. Props are much safer. But if you've already got it up and working, no reason to change just yet--just make sure they're all converted before any interaction occurs.
If u feel the urge to use props, you might have a look at the 'Terror'-Mod where i have used props for some random spawn. ('Farm'- Mod might give you some headache as the spawn there not only is about different aliens, but also about different UFOs)
But you could simply give those dummies some TU,EN,ect. with no weapon in their hands it's unimportant if they react or not. You'll only have to mutate them into an entity that is auto equipped in the entities.xt. (A test worked with INVENTORY=TRANSFER_FULL )