Help with Mod

Post your mods and custom content here

Help with Mod

Postby danievdw » Sun Nov 09, 2014 6:10 am

Hi

I am trying to create a event that spawn Goblins around goblinpole/goblinhead . I used the whisperdeath event as a template, but my mod keep crashing the game.


<event>
<id>goblinmarch</id>
<name esES="Susurros de muertos vivientes">March of the Goblins</name>

<icon>event_whisperdeath</icon>
<order>4</order>

<minPopulation>30</minPopulation>
<items>goblinpole,goblinhead</items>
<itemsSpawnLiving>goblin,goblin,goblin,goblin,goblin,goblin,goblin,goblin,goblin,goblin,goblin,goblin,goblinleader</itemsSpawnLiving>
<itemsSpawnLivingSize>1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1</itemsSpawnLivingSize>

<eventCooldown>120</eventCooldown>

<turns>240</turns>
</event>

Any advice would be great, thank you.
danievdw
 
Posts: 3
Joined: Sun Nov 09, 2014 6:07 am

Re: Help with Mod

Postby YetiChow » Sun Nov 09, 2014 8:34 am

first off, having multiple instances of the same living in the spawn list is redundant... that could well be the cause of the crash. Even if it's not the cause, it's pointless extra work to keep track of ;) Unless of course you're following a direction in the commented code in events.xml, it's been a while since I read it (and I don't have it handy on this computer) :lol:

I'm guessing that the event also isn't tied in properly somewhere if it's throwing a crash right at the start of the game... possibly it's missing an icon to show up on the events section of the UI? That's one that would be easy to overlook...

Basically, go into every file and do a search for "whisperdeath", and if there's anything relating to it in that file you'll need to include an entry for your custom event to go with it. Off the top of my head there will be the events.xml and graphics.ini (which is one folder level up from the data folder). There could be a reference somewhere you wouldn't expect.

If you have a crashlog, paste it in here (remember to use the code function if it's long - hit that "code" button on the top of the posting box, and put the log between the tags that look like [code]
What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.
User avatar
YetiChow
 
Posts: 3149
Joined: Wed Apr 25, 2012 9:26 am
Location: Cramped between a Yeti's small intestine and its stomach... trying not to dissolve!

Re: Help with Mod

Postby danievdw » Sun Nov 09, 2014 8:51 am

Well, this is the code I cannibalized :

Code: Select all
<event>
      <id>whisperdeath</id>
      <name esES="Susurros de muertos vivientes">Living death whispers</name>

      <icon>event_whisperdeath</icon>
      <order>3</order>

      <minPopulation>65</minPopulation>
      <items>grave,gravebury,tomb,tombbury,tombbury1,mosstomb,lizardtomb,sipstomb,vechstomb,punchwoodtomb,maleroguetomb,femaleroguetomb,dwarftomb,barbariantomb,elftomb,magetomb,knighttomb,highlandertomb,herbalisttomb</items>
      <itemsSpawnLiving>zombie,infectedzombie,zombie,infectedzombie,infectedzombie,zombie,toponovichthezombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie,infectedzombie</itemsSpawnLiving>
      <itemsSpawnLivingSize>1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1,1d2-1</itemsSpawnLivingSize>

      <eventCooldown>120</eventCooldown>

      <turns>240</turns>
   </event>



So I only changed the items that initialize the spawn, the population limit and what type of monsters spawn. Figuring that using existing icon would be ok. I checked items.xml that I use correct names for items and monsters in the ref.
danievdw
 
Posts: 3
Joined: Sun Nov 09, 2014 6:07 am

Re: Help with Mod

Postby YetiChow » Mon Nov 10, 2014 1:16 am

Yep, I see the problem now - look at the number of "1d2-1", and the number of spawning items in the original. They match.

The problem on your version is that you've told the game to spawn 1d2-1 goblins on 19 different items, but only put 2 items in the list - so it looks for the other 17, thinks "OMFGWTFAMISUPPOSEDTODOHERENOW?, has a heart attack, and spits a crash-to-desktop :lol:

Either match the number of enemies and their spawn controls down to the number of spawner items you're actually using, or add more spawner items to the list. The way that the example event works is that each item, enemy and spawn control (number, i.e. 1d2-1) all line up. So for example each grave spawns 1d2-1 zombies, each mossy tomb spawns 1d2-1 infected zombies, and each lizard tomb spawns exactly one "Toponovich, the Zombie" boss

Personally, I'd say take it down to just the goblin poles (the heads will be scattered all over the place), and instead of lots of small spawns have it set to a bigger spawn number like 1d20+2 (so you get minimum 2, maximum 22 goblins per goblin pole). Alternatively if you want more of a scattered swarm of goblins, keep the heads and just have each of them spawn however many zombies; and make the goblin poles spawn goblin leaders. But you need to have the item, monster and number control each for a set - if you have a random controller, monster or item laying around in your code, the game won't have a clue what to do with it :lol:
What's that you're eating? A nice, juicy apple? You weren't supposed to eat that you fool, you were supposed to make it into a pie! - last words recorded words of Francis D'Avre before he went looking for snowcherries, but found a hungry Yeti instead.
User avatar
YetiChow
 
Posts: 3149
Joined: Wed Apr 25, 2012 9:26 am
Location: Cramped between a Yeti's small intestine and its stomach... trying not to dissolve!

Re: Help with Mod

Postby danievdw » Mon Nov 10, 2014 2:02 am

Ah, thanks very much
danievdw
 
Posts: 3
Joined: Sun Nov 09, 2014 6:07 am


Return to Modding

Who is online

Users browsing this forum: No registered users and 3 guests

cron