Quest mod questions...

 

Has anyone been able to get a quest result to spawn a unit or unit group? I can see how to get a quest to spawn a goodiehut, since there are examples in the corequest files. But I cannot figure out how to get a unit or unit group to spawn based on a quest result. I want to have a unit spawn if the user makes a certain choice. I assume you use the gamemodifer as with spawning goodie huts...

 

<GameModifier InternalName="CreateGoodieHut">

 <ModType>Map</ModType>

 <Attribute>CreateGoodieHut</Attribute>

 <UnitClass>RatNest</UnitClass>

 <StrVal>Rat Nest</StrVal>

<Radius>8</Radius>

</GameModifier>

 

I can get a goodiehut to spawn using the above xml if the user makes a certain choice, but I haven't been able to tweak it to make a unit spawn instead. Tried a bunch of different combinations of things such as making the modtype 'Unit' and the Attribute 'CreateUnit', etc, and could not get the gamemodifier element to do it.

 

 

A more general question/request for Stardock, any chance we can get a data dictionary for the XML schema? I'm really struggling figuring out what I can do with quests, and how to do it. 

 

 

17,539 views 30 replies
Reply #1 Top

This ought to do the trick:

<!-- This is the escort NPC that must be brought to the target goodie hut -->

<GameModifier InternalName="EscortNPC">

<ModType>Unit</ModType>

<Attribute>UnitJoinArmy</Attribute>

<StrVal>EscortSon01</StrVal>

<UnitClass>Unit</UnitClass>

</GameModifier>

This will let you choose the person = <StrVal>EscortSon01</StrVal>

I think <UnitClass> determines what kind of unit you receive, such as unit, hero, sov, creature. I am guessing of course.

<Attribute>UnitJoinArmy</Attribute> This will both create said unit and add him or her to your faction.

<ModType>Unit</ModType> This tells the it what to spawn? I am not really sure.

Reply #2 Top

 

Thanks Sean, I did see that in your Dawn example quest, but I'm wanting to have the unit spawn seperately from my stack, so it becomes a wandering monster. Again, tried a bunch of variations of the gamemodifer stuff and just couldn't get it to do it. I'm sure it must be possible but I'm failing to figure it out after several hours of trying.

I'm making a "go kill some zombies" quest, and I want a zombie or unit of zombies to spawn in the vicinity of the quest destination goodiehut if the player chooses not to fight the zombies.

Reply #3 Top

I also want to make goodiehuts that function as lairs that spawn monsters from time to time, I assume the xml to do this would be the same as what I am trying to achieve with my quest.  This must be possible because I remember this was happening in one of the beta versions. 

Reply #4 Top

In that case I would try using this from the summoning section:

<GameModifier InternalName="SummonUnit">

<ModType>Unit</ModType>

<Attribute>SummonUnit</Attribute>

<UnitClass>Imp</UnitClass>

<StrVal>Imp</StrVal>

<Radius>3</Radius>

<Duration>-1</Duration>

</GameModifier>

I added a radius from the quest section so this might just be totally ineffective, but try it out if it makes sense.

Reply #5 Top

 

Doh, I should have thought of looking at the summoning examples, thanks! I'll try this later tonight.

 

Starting to get excited about the quest modding capabilities, could make whole little mini-campaigns with enough time and effort.

 

 

 

 

 

 

Reply #7 Top

 

Darn, it seems that the SummonUnit atribute only summons the unit as a member of your own faction, and only on the tile where the objective is located. So the radius option isn't functional for that attribute.

 

This is very frustrating since a very simple XML schema for the quest-related xml files would save hours of blind poking around.

 

 

 

 

Reply #8 Top

I would hope that after they open the python to us we can change it so that it works. The only reason we can't now is that their quests didn't use the function. <X3

Reply #9 Top

 

Well after a few more hours I can't find any way to do what I wanted ;(  

 

Tried the gamemodifier tag, the summon tag, encounter, etc. Can't find any example of, or documented, way to have a quest objective spawn a wandering monster.

I can spawn goodiehuts using gamemodifier, I can spawn a friendly unit residing in the same tile using the summon element, and I can spawn a enemy unit that I fight on the tactical map using the encounter element, but if there is a way to spawn a wandering monster then it must be undocumented and/or no example of it in the base game xml files. This is a bummer because I wanted to create quests the unleash enemy monsters if you avoid or fail in the tasks given. I bet there is a way to do it, but without knowing all the available attributes I can't do it without days of guess work.  

 

Bobby

Reply #10 Top

*<SpellTargetType>Any</SpellTargetType>

<ValidTerrainCategory>Land</ValidTerrainCategory>

<ValidTerrainCategory>Forest</ValidTerrainCategory>

<ValidTerrainCategory>City</ValidTerrainCategory>

<ValidTerrainCategory>Mountain</ValidTerrainCategory>

You may have moved on but I might as well post a few more things I am thinking of using to do what you wanted...

*<SpellTargetType>NeutralGround</SpellTargetType>

*<SpellTargetType>Monster</SpellTargetType>

 

The thing would depend on directing it to the desired loaction.

Reply #11 Top

 

Would that be used within the summon attribute? Not sure about the context for those xml tags Sean.

 

I'm hoping Frogboy's quest mod dev forum posts will answer my questions. 

Reply #12 Top

I think if I understand you there is already a quest that is in game that does something like this quest does from in the Core Quests folder "Quests_commonquests.XML":

Code: xml
  1. &lt;QuestDef InternalName="Quest_TheSilverFlute"&gt;
  2. <span> </span>                              &lt;DisplayName&gt;The Silver Flute&lt;/DisplayName&gt;
  3. <span> </span>                                 &lt;PrefQuestLoc&gt;Quest_Level1_Inn01&lt;/PrefQuestLoc&gt;
  4. <span> </span>                                &lt;Description&gt;Inside the inn, you meet an old adventurer. After a few hours of discussion, he tells you of legend of The Silver Flute and describes where you can find it. Are you up for it?&lt;/Description&gt;
  5. <span> </span>                               &lt;QuestClass&gt;Minor&lt;/QuestClass&gt;
  6.                                &lt;Repeatable&gt;0&lt;/Repeatable&gt;
  7.                                &lt;TriggerType&gt;QuestLocation&lt;/TriggerType&gt;
  8.                                &lt;TriggerOrigin&gt;EventLocation&lt;/TriggerOrigin&gt;
  9.                                &lt;SpawnRating&gt;1&lt;/SpawnRating&gt;
  10.                                &lt;Image&gt;TombMedallion.png&lt;/Image&gt;
  11.                            &lt;!-- This objective is to find the location of the dragon fountain and move to clear it --&gt;
  12.                            &lt;QuestObjectiveDef InternalName="Objective0"&gt;
  13.                                         &lt;ObjectiveID&gt;0&lt;/ObjectiveID&gt;
  14.                                         &lt;NextObjectiveID&gt;1&lt;/NextObjectiveID&gt;
  15.                                         &lt;Description&gt;The Silver Flute is located in the nearby Temple of the Dragon Fountain.&lt;/Description&gt;
  16.                                         &lt;GameModifier InternalName="CreateGoodieHut"&gt;
  17.                                                   &lt;ModType&gt;Map&lt;/ModType&gt;
  18.                                                   &lt;Attribute&gt;CreateGoodieHut&lt;/Attribute&gt;
  19.                                                   &lt;UnitClass&gt;DragonFountain&lt;/UnitClass&gt;
  20.                                                   &lt;StrVal&gt;Dragon Fountain&lt;/StrVal&gt;
  21.                                                   &lt;Radius&gt;8&lt;/Radius&gt;
  22.                                         &lt;/GameModifier&gt;
  23.  
  24.                                         &lt;QuestConditionDef InternalName="Condition1"&gt;
  25.                                                    &lt;Description&gt;The Silver Flute is at the Dragon Fountain.&lt;/Description&gt;
  26.                                                    &lt;Class&gt;Success&lt;/Class&gt;
  27.                                                    &lt;Type&gt;ClearGoodieHut&lt;/Type&gt;
  28.                                                    &lt;TextData&gt;DragonFountain&lt;/TextData&gt;
  29.                                                    &lt;Flag&gt;RevealTarget&lt;/Flag&gt;
  30.                                          &lt;/QuestConditionDef&gt;
  31.                                      &lt;ChoiceText&gt;As you near the majestic fountain, a band of brigands approaches. "So, another adventurer trying to find the Silver flute. Well, we were here first!"&lt;/ChoiceText&gt;
  32.                                      &lt;ChoiceMedallion&gt;Gfx\\Medallions\\K_Adventure.png&lt;/ChoiceMedallion&gt;
  33.                                      &lt;ChoiceMedallionFrame&gt;Gfx\\Medallions\\Medallion_Frame_01.png&lt;/ChoiceMedallionFrame&gt;
  34.  
  35.                                       &lt;!-- Choice 0 --&gt;
  36.                                             &lt;QuestChoiceDef&gt;<span> </span>&lt;Description&gt;Oh, sorry. I will leave.&lt;/Description&gt;
  37.                                            &lt;NextObjectiveID&gt;-1&lt;/NextObjectiveID&gt;
  38.                                            &lt;PopupMessage&gt;You hear one of the bandits murmur "coward" as you depart.&lt;/PopupMessage&gt;
  39.                                       &lt;/QuestChoiceDef&gt;
  40.  
  41.                                       &lt;!-- Choice 1 --&gt;
  42.                                         &lt;QuestChoiceDef&gt;<span> </span>&lt;Description&gt;The treasure is mine. Prepare to die!&lt;/Description&gt;
  43.                                              &lt;NextObjectiveID&gt;1&lt;/NextObjectiveID&gt;
  44.                                              &lt;!-- Create some bad guys, first one becomes the leader --&gt;
  45.                                              &lt;Encounter InternalName="RogueWizardPosse"&gt;
  46.                                                   &lt;Liklihood&gt;100&lt;/Liklihood&gt;
  47.                                                   &lt;LevelLo&gt;2&lt;/LevelLo&gt;
  48.                                                   &lt;LevelHi&gt;4&lt;/LevelHi&gt;
  49.                                                   &lt;WillRespawn&gt;0&lt;/WillRespawn&gt;
  50.                                                   &lt;WanderingRadius&gt;0&lt;/WanderingRadius&gt;
  51.                                                   &lt;UnitInstance&gt;<span> </span>
  52.                                                           &lt;UnitType&gt;Bandit&lt;/UnitType&gt;
  53.                                                           &lt;UnitName&gt;Brigand Leader&lt;/UnitName&gt;
  54.                                                           &lt;Level&gt;1&lt;/Level&gt;
  55.                                                   &lt;/UnitInstance&gt;
  56.  
  57.                                                  &lt;UnitInstance&gt;
  58.                                                            &lt;UnitType&gt;Bandit&lt;/UnitType&gt;
  59.                                                            &lt;Level&gt;1&lt;/Level&gt;
  60.                                                  &lt;/UnitInstance&gt;
  61.                                           &lt;/Encounter&gt;
  62.                                        &lt;/QuestChoiceDef&gt;
  63.                            &lt;/QuestObjectiveDef&gt;
  64.                            &lt;!-- This objective is to kill the Bandits  --&gt;
  65.                            &lt;QuestObjectiveDef InternalName="Objective1"&gt;
  66.                                     &lt;ObjectiveID&gt;1&lt;/ObjectiveID&gt;
  67.                                     &lt;NextObjectiveID&gt;-1&lt;/NextObjectiveID&gt;
  68.                                     &lt;Description&gt;Kill the brigands!&lt;/Description&gt;
  69.                                     &lt;PopupObjectiveMsg&gt;0&lt;/PopupObjectiveMsg&gt;
  70.                                     &lt;QuestConditionDef InternalName="Condition2"&gt;
  71.                                            &lt;Description&gt;Kill the brigands!&lt;/Description&gt;
  72.                                            &lt;Class&gt;Success&lt;/Class&gt;
  73.                                            &lt;Type&gt;KillMonster&lt;/Type&gt;
  74.                                            &lt;TextData&gt;Bandit&lt;/TextData&gt;
  75.                                            &lt;MoreTextData&gt;Brigand Leader&lt;/MoreTextData&gt;
  76.                                            &lt;NumericData&gt;1&lt;/NumericData&gt;
  77.                                   &lt;CompletionText&gt;After eliminating the brigands, you begin your search in earnest. Several back-breaking hours later, you have enough material for a yard sale and a small, unmarked box containing the Silver Flute.&lt;/CompletionText&gt;
  78.                                   &lt;GameModifier InternalName="Reward1"&gt;
  79. <span>                                               </span>&lt;ModType&gt;GiveItem&lt;/ModType&gt;
  80.                                                &lt;Attribute&gt;SilverFlute&lt;/Attribute&gt;
  81.                                   &lt;/GameModifier&gt;
  82.                                 &lt;/QuestConditionDef&gt;
  83.                         &lt;/QuestObjectiveDef&gt;
  84.                  &lt;/QuestDef&gt;

Based on the choice made the bandits spawn on don't spawn, since there is a repeatable tag I would also presume you could make it so that you could get respawns from it.  The <WanderingRadius> variable should control the range it move from the spawn point and the units spawned are the <UnitInstance> and call the monsters from the monsters list if I am interpreting everything correctly.

Reply #13 Top

 

I think that just results in an encounter being created, where the player is taken to the tactical map and fights that group of brigands. Then if the brigands win they stay on the map and will wonder within the wandering radius. What I want to do is spawn the units onto the map without the tactical battle encounter happening. It's probably something simple that I am missing.

 

Reply #14 Top

This actually will do that I think - just need to add the line <radius> X </radius> in order to give it a spawn location within x of the encounter point I remember there is another quest that results in an Alpha Wolf being spawned and also an encounter at the location of the Alpha Wolf I'll see if I can find it.  The Akpha wolf when it is spawned if vissble on the map as though it were a wandering monster.

 

edit:  I found it - look in Quests_Level2.XML  the first quest is Maggie's Quest and it has all the elements in it at least for a starting point I think  you will need to change the <WanderingRadius> in order to have them move around like you desire though.

Reply #15 Top

 

I'll check that out tonight, thanks! I guess I should have looked harder at some of those base game quests.  If I can do this then it makes a whole class of quests possible, where monsters get unleashed if you fail the quest objectives or make the wrong choice. You could then link these together into whole little mini-campaigns. 

Reply #16 Top

Glad to provide the assist, you might also look at an idea I have had and posted in the Elementerra thread.  I think it is possible to create custom tactical maps just like custom regular maps.  This in turn means that it might be possible to create "dungeons" or "lairs" for NPCs or Monsters.  these could be designed to change the battle mechanics so that typical tactics aren't as effective and once some experimentation is done with it to see if fog of war could be implemented on these tactical maps so that players wouldn't know where the monsters / NPC would start, this could change quests significantly and make them more interesting by far.

Reply #17 Top

 

Yep, I've already created quests that spawn tactical battle encounters. And I had the thought that by creating a custom tactical map, you could have a dungeon. Bam. Of course right now theres no art assets for that so it would be a huge task. Plus, creating monsters and treasure and triggers inside the custom tactical map would be a daunting task - you could proably do it by having quests nested inside tactical map, and wandering monsters in there, etc, if thats even possible right now in the xml?

  Ultimately, it should be possible to create entire complex ultima-style dungeons.

 

 

Reply #18 Top

 

Also you'd need to limit the dungeon encounter to only allow heroes or sovereigns inside. 

Reply #19 Top

Quoting Bobby, reply 15
 

I'll check that out tonight, thanks! I guess I should have looked harder at some of those base game quests.  If I can do this then it makes a whole class of quests possible, where monsters get unleashed if you fail the quest objectives or make the wrong choice. You could then link these together into whole little mini-campaigns. 
End of Bobby's quote

 

The way they handled it, is through adding the unit as part of the goodie hut, which contains the second wolf encounter.

 

Code: xml
  1.  
  2. &lt;GoodieHutType InternalName="Level2_WolfPack_01"&gt;
  3.     &lt;Name&gt;Pack of wolves&lt;/Name&gt;
  4.     &lt;SpawnRating&gt;-1&lt;/SpawnRating&gt;
  5.     &lt;Description&gt;This may not be a safe place to visit.&lt;/Description&gt;
  6.     &lt;Medallions&gt;
  7.       &lt;All&gt;CaveGrassland_Medallion.png&lt;/All&gt;
  8.     &lt;/Medallions&gt;
  9.     &lt;Encounter InternalName="WolfPack"&gt;
  10.       &lt;Liklihood&gt;100&lt;/Liklihood&gt;
  11.       &lt;LevelLo&gt;2&lt;/LevelLo&gt;
  12.       &lt;LevelHi&gt;4&lt;/LevelHi&gt;
  13.       &lt;WillRespawn&gt;0&lt;/WillRespawn&gt;
  14.       &lt;WanderingRadius&gt;0&lt;/WanderingRadius&gt;
  15.       &lt;UnitInstance&gt;
  16.         &lt;UnitType&gt;Wolf&lt;/UnitType&gt;
  17.         &lt;UnitName&gt;Alpha Wolf&lt;/UnitName&gt;
  18.         &lt;Level&gt;2&lt;/Level&gt;
  19.       &lt;/UnitInstance&gt;
  20.     &lt;/Encounter&gt;    
  21.     &lt;Destructable&gt;1&lt;/Destructable&gt;
  22.     &lt;TileDesign&gt;A_WolfPack_01&lt;/TileDesign&gt;
  23.     &lt;DrawnIcon&gt;Gfx/TacticalIcons/Quest_Cave1.png&lt;/DrawnIcon&gt;
  24.     &lt;IconSize&gt;50&lt;/IconSize&gt;
  25.   &lt;/GoodieHutType&gt;

Reply #20 Top

hmm, that still might not achieve what I am aiming for then, since that unit would just be sitting there inside the goodiehut until it gets encountered. I want the unit to spawn on the map and then wander within a specified radius, without needing the tactical encounter. This would also allow us to create lairs. 

Reply #21 Top

Looking at it carefully I think I am right this creates two things the location and the wandering / stategic map pack of wolves they have a wnadering Radius of 0 though so they stay in that location.  The Location then triggers another battle with another group of woves based on it's own trigger which is in Quest_Part_2_TheWolfBattle.

Reply #22 Top

 

hmm, you may be right. I'll try it out tonight after work. Thanks! If you are correct, then this would allow for having quest results spawn monsters, and also creating lairs in general

 

 

 

Reply #23 Top

Well I tried all the ideas suggested in this thread and nothing seems to work. The encounter tag only produces tactical battles, it doesn't result in spawning a unit on the map. (unless that unit wins the encounter, then it remains on the map)

I can get it to spawn a goodiehut that has an icon that looks like a unit, and then have that goodiehut create an encounter if you move on it. But that goodiehut itself can't move, so its just simulating a unit that is frozen in place.

 

Also tried different things with the summon attribute, gamemodifier, etc, and nothing seems to do it. 

 

This is intensely frustrating, it must be possible but I just cannot get the xml to do it yet. Starting to wonder if maybe its just not possible? 

Reply #24 Top

I just read the quest tutorial by frogboy and it seems he intended us to use the gamemodifier and set it as unit. The modtype is map. You should take a look at the functions for map on the tutorial. One of them is SummonUnit. This would seem to allow a creature to be spawned that is not of your faction. It is listed there as 4.k.

Reply #25 Top

 

I tried what you are saying, using the modtype of 'map' and then the 'summonunit' attribute, couldn't get it to work at all. Its probably just some syntax I am screwing up or something, I wish Frogboy would post an example of this being done.