Dynamically Spawning Entities

Post » Sun Aug 25, 2013 6:48 pm

So I have spent the last week poking the toolkit and I made a little mod. It is really just a proof of concept, but I have hit a snag and I am looking for some advice.

So how my mod works... When you talk Loosum Hagar (wingstick girl), I changed the text description of her task so that she says she will come along with the player if they can beat her score of 10. When you finish the wingstick challenge, you get a new custom item that is sort of like a Loosum Collectors card. Except that this is a quick use item. You can equip it, use it and it summons an NPC to your side.

The idea was to build a companion system on top of the current sentry bot system. Various NPCs would offer to come along with you and you would receive their summon item, which is basically just a profile picture of their face, name and brief description. This would help get around any terrain traversal bugs and issues.

And everything is working pretty well. That is, the item works. The custom texture and text are used by Rage when installed. The only snag is that I have found if I try to dynamically spawn an entity that is not declared/embedded in the current map, I get an error in the console that says animation file not found and it crashes to the main menu with no save.

So for example, if I link Loosum's calling card to a friendly Ghost Bandit. It will work fine if I am in a map that has Ghost Bandits in it. But if I go to a map like the Wasted Garage, the game crashes to menu. Conversly, if I hook the calling card up to a Wasted Bandit (that is the only change I make), it will work from the Wasted Garage, but the game then crashes If I try to use it from the Ghost Bandits hideout.

A few years back, I modded a game called Vampire The Masquerade Bloodlines. The engine had a restriction where the entities model and textures had to already be in memory when you attempted to spawn them or the game would crash. To guarantee a model was in memory, an instance had to be embedded into the map that you tried to dynamically spawn them from. So to allow companions to follow the player through the entire game, I had to embed instances of them into all the maps so that the game wouldn't crash when I spawned them.

So my question: Is anyone aware of similar restrictions with IDTech5? If so, is there a common method of declaring an entity for pre-load with all maps.. or does each map have to manually include its entities like the source engine games? Maybe a parent map that is inherited that can be updated? Maybe a way via scripts? I don't know the scripting language very well. Considering there are modders making maps for this game, it is probably good to know if embedding deployable entities is necessary for stability. Certainly users will try to build their sentry bots in the new maps. Maybe someone who is building a map can try to build/spawn the games sentry-bot in their custom map and see if things break.

User avatar
Antony Holdsworth
 
Posts: 3387
Joined: Tue May 29, 2007 4:50 am

Return to Othor Games