Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Editor - Creating Quests
Author Message
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #1
Editor - Creating Quests
I've been mucking around in the editor a bit and looking at some of the maps that came with the game to learn more. I started looking at the .lua file for some maps too.

Specifically, I was trying to see if I could figure out how to set up a simple quest, like kill 10 heros or something simple like that, or like the gold quest in the Dark Lord Campaign where you had to collect gold when you were showing the Collosi how the dungeon stuff works to get them to help you out.

From what I've seen in the editor, setting up a quest looks fairly straight forward, aside from the character dialog and such. I was looking in the .lua file hoping I could find the quest function for a quest in one of the official levels to see what it looks like but i didn't see those functions in the object functions .lua file.

So I'm wondering if anyone can tell me how to setup quests in a DUNGEONS: The Dark Lord map.


EDIT: I know where the quest scripts are now and I am studying them.

EDIT2: I think I now understand for the most part how to make a quest, including making the script file for it. However I am having one problem that I can't seem to overcome so far. I have created a localization folder in my map folder and inside that is an en folder and inside of that is a file called texts-en-modify.csv. Inside this file I have placed the text IDs for my quest to define the text to display in the dialogs and to define the quest name. However, it doesn't work. The quest shows up in the quest log window in-game, but the title and description text areas for the quest are both totally blank. It would seem it is not reading the text ids from the file but I don't know what I'm doing wrong. Sad


PS: Once I have a simple quest working and really know what I'm doing, I'll write up a tutorial on making quests if you guys would like Tongue
(This post was last modified: 17-02-2012 01:56 PM by Megafont.)
17-02-2012 06:12 AM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #2
RE: Editor - Creating Quests
Quests.. hm.. basically you create the QUEST object, fill in the lua callback functions and assign event handlers. There are handy shortcuts to set names and create appropiate files for you in the context menu of the editor. Try right-clicking the property where you would enter the script name.


About the csv file: don't name the csv with "-modify". That's only if you want to *change* lines that already exist in the original file. You most probably want to define new ID's to translate (which you use in your quest and can set from Lua). To add lines, just name the csv like the original (e.g. texts-en.csv, texts-fr.csv and so on).

Special for localization: You can also create only one file called "texts.csv" directly in the localization subfolder which contains one column per language, if you like. Look at my doors.zip mod for an example. Kind of easier, if you are the only translator anyway.. Wink

[Image: ds18.jpg]
17-02-2012 03:26 PM
Find all posts by this user Quote this message in a reply
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #3
RE: Editor - Creating Quests
I figured most of this out by looking in the editor and the wiki. I'm just having trouble with the .csv file. My map folder is called MyFirst. And in MyFirst\localization\en\ I have the file texts-en.csv now. Inside the file is this:

Code:
ID,"en"
"dlg_kill_heros_intro","Isn't it nice to get to relax a bit, Master? How about a little game of hero hunting? Kill 10 heros because its fun!"
"dlg_kill_heros_quest_reward","Reward text."
"qst_kill_heros_quest_name","Hero Hunting"
"qst_kill_heros_quest_progress","Heros Killed: {C}"


When I test run the map though, I can open the quest log window and see a quest there, but there is no text whatsoever. The title and description areas are both empty. I notice now that there is a second item in the quest log titled "Sandbox" and the description is the description text of the map. The progress text is not showing on-screen either. I renamed the file from texts-en-modify.csv to texts-en-modify.csv like you said. I have set the text ids in my QUEST object of course and double checked that they are correct. I have my script file started too but I can't see if its working if it doesn't show the text Tongue

By the way, this map is not in an archive since I'm messing around with it and not distributing it. It's still just in its folder in my appdata folder.


EDIT: If I copy the entries from my texts-en.csv file and paste them at the end of the game's own texts-en.csv file, the text shows up in-game then. Am I supposed to add my text ids in there and then put them in my own .csv file later when i make a mod archive then? My quest isn't quite working though. Nothing happens when I kill a hero lol. I know I'm close to having a working quest though!

Aside from this issue, I now have a working quest Tongue
(This post was last modified: 18-02-2012 06:21 AM by Megafont.)
18-02-2012 02:34 AM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #4
RE: Editor - Creating Quests
Ah, ok.. sorry. Now I know where the problem is.

There are two types of zip-distributions. "map" zips and "mod" zips. Mods are game-global and will be loaded when dungeons starts. Maps are loaded when a map start.

Most things you can do in a "per-map" basis. But some won't work, for example the localization system is initialized when the game starts and not refreshed on map start so changes to localization must be in a "mod". (Actually.. when writing it like this it doesn't make too much sense, as many text ids are only used in a single map. However, you have to think how we do translations here usually: Create one big file then ship it to some professional and get the translation back. Thinking it this way it makes more sense to have the localization "global").

Anyway, since you can add maps to a "mod" zip. So you have to juggle your files a bit around:

Make a subdirectory in mods/ subfolder named after anything you like to name your mod. There, create the "localization/" subdirectory and put the csv in there.

Once you are finished with your map, you can move the directory from your maps/ folder into a maps/ folder within your mod-folder.

So lets assume you name your map "exampleQuest" and the mod "exampleTranslationWithQuest", then the directory structure within your "mods" directory is like this:

Code:
exampleTranslationWithQuest/
    localization/
        en/
            texts-en.csv
        fr/
            texts-fr.csv
    maps/
        exampleQuest/
            level.zap
            object_templates.xml
            description.xml
            ...

This is also the directory struction within the zip file if you package the map later.

Hope it helps, Imi.

Lemme see whether I finish the "add localization" feature to the editor later. It's half-implemented by now (only reading, no writing).

[Image: ds18.jpg]
(This post was last modified: 18-02-2012 05:27 PM by imi.)
18-02-2012 05:15 PM
Find all posts by this user Quote this message in a reply
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #5
RE: Editor - Creating Quests
Thanks! You've been very helpful!

I'll keep experimenting and learning and get around to writing that quests tutorial soon I think. Tongue I'm enjoying messing around with this stuff, though truth be told I'm no stranger to level editors and modding, or programming for that matter either (so the scripting doesn't scare me)! lol. The scripting really opens up tons of modding possibilities, as opposed to a game whose editor just lets you place objects but doesn't have scripts (so you can only do things the devs already programmed in).

The wiki has been very helpful too. It must've taken a long while for you to get the api listing and everything up there.

I was going to ask you what the second parameter of the Tell function does, but I think I've figured it out. At first I thought maybe it specified which character image to show on the dialog window but I have observed that this is not the case. It always displayed the ? mark image regardless of the value I passed in. So looking at the official scripts, I'm guessing the character image displayed is whoever the camera is focused on. Anyway, I notice in the script for the intro sequence of the first tutorial map that we see this line:

Code:
Tell("dlg_escape_intro", 2)

Looking in the texts_en.csv file I see there is no entry called "dlg_escape_intro", but rather there are entries called "dlg_escape_intro_1_succubus" and "dlg_escape_intro_3_succubus". This one line of script causes both of these entries to be displayed. So I conclude that the Tell function gets the first matching ID, and then the 2nd parameter tells it how many consecutive matching IDs to display the text of.
(This post was last modified: 19-02-2012 01:25 AM by Megafont.)
19-02-2012 12:37 AM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #6
RE: Editor - Creating Quests
you guessed right. Wink

First parameter is the prefix and second parameter is how many ID's are played (in alphabetic order). The dialog system will remember the last state, so basically

Code:
Tell("dlg_escape_intro", 2)

should be the same as

Code:
Tell("dlg_escape_intro", 1)
Tell("dlg_escape_intro", 1)

The "guy who is speaking" - we call him "teller" - is the last part in your Language ID (everything after the last _ ). The game will search for a GUI resource named "dialogue_teller". So if you want a custom image there, place an image named... say.. "dialogue_evilgenius.png" into your top-level directory of your mod directory/zip file and then create a gui.lst and list the filename there as described here.

Oh, and if you add a new teller, you should add a language ID "teller_teller" (e.g. id "teller_evilgenius"). The name of the teller is shown in the ingame dialog log.

PS: I activated your account on the wiki. Welcome. Smile

[Image: ds18.jpg]
(This post was last modified: 19-02-2012 01:47 AM by imi.)
19-02-2012 01:45 AM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #7
RE: Editor - Creating Quests
Version 1.0.2.2 of the Editor now supports creation and editing of map-specific language IDs.

At least if the map is saved as a mod (in mods/ directory as described above). This is also now the default save location.

[Image: ds18.jpg]
19-02-2012 03:05 AM
Find all posts by this user Quote this message in a reply
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #8
RE: Editor - Creating Quests
Thanks for activating my account Big Grin

Thanks for the editor update too! Its awesome! Now we can add map specific language IDs without even leaving the editor Big Grin

I've been messing with the editor a bit more. Just now I was messing with Template Editting. I took the DUNGEONLORD template and made a custom version of it called SIDEKICK_AS_DUNGEONLORD. All I did was change the mesh to sidekick.mesh and now Mr. Sidekick is a dungeonlord! lol. It doesn't quite work though as he just slides along with no animation when you tell him to go somewhere in the dungeon. lol
(This post was last modified: 19-02-2012 12:39 PM by Megafont.)
19-02-2012 04:16 AM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #9
RE: Editor - Creating Quests
And hows going? Any playable map? Big Grin

About Template editing: That's actually only needed if
1) You want to add components to entities for this map. You cannot do this in object editing alone, so you have to subclass your template.
2) You want to create entities dynamically from LUA and don't want to write all the changes from there, but nicely setting them in some editor.

If you just want to manipulate some properties, you can also use the Object Editing tab.

[Image: ds18.jpg]
20-02-2012 12:54 PM
Find all posts by this user Quote this message in a reply
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #10
RE: Editor - Creating Quests
Hi. I was a little sidetracked yesturday but before that I did also play around with making a sequence in my little map. When you finish the killing heros quest, the camera zooms in on a gate which then opens.

I had a little trouble getting my door to open due to some scripting errors at first but I got it working.

As for the template editting, what you said makes perfect sense. I was just messing around but it kinda made sense to make a new template since sidekick isn't an avatar. Although I guess I could've taken the SIDEKICK template and added the components to it that the avatar templates have that SIDEKICK doesnt, such as CmpAvatar. lol However, it seemed it would be easier to do it this way since I assumed it would retain the default values from the DUNGEONLORD template, and thus reduce some problems that I may have had otherwise Tongue

But I'm not overly concerned about Sidekick as a dungeon lord since I'm guessing the animation problem I had with him is because his mesh lacking some stuff possibly since he is not normally a dungeon lord. Although I know Sidekick has a walking animation because he walks up to Calypso at the beginning of the Dark Lord campaign. So I may have something setup wrong too or something. Also, when attacked by heros he will move his arm to attack sometimes, but he just stands there motionless in between attacks, like a statue. Sort of like in the original game he pretty much just stood near your throne all the time. He also will do his idle animation while standing still.

So yea its going well. I'm still just learning new things but I'm getting to the point where I could probably start making a serious map or make that quests tutorial Tongue lol
(This post was last modified: 21-02-2012 03:59 AM by Megafont.)
21-02-2012 03:56 AM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #11
RE: Editor - Creating Quests
Yes, exchanging meshes is a bit tricky, because you would have to make sure that all skeletal animations are present with the exact same names in the other mesh.

Sidekick can move and I think also attack, but AFAIK he doesn't have a defend or evasion - animation (that was probably the thing you saw in combat). Also, he has no casting animations, so all spells would look awkward.

You could in theory add the missing animations (if you are into animation rigging), but its not really an easy step to start modding with. Wink

[Image: ds18.jpg]
21-02-2012 04:54 PM
Find all posts by this user Quote this message in a reply
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #12
RE: Editor - Creating Quests
Yea, I'm not into animation rigging lol. I haven't done much modeling or rigging. I am familiar with 3D graphics though from spending a lot of time mapping for Valve's Source Engine in the past Tongue The original Half-Life was the game that got me into mapping. When I found out about the Hammer Editor I just had to get it and start playing with it. Tongue

So I am familiar with how models have animations and I'm familiar with the idea of bones in models too. I've just never done much modeling at all and I've never done any animation rigging lol. But obviously Sidekick is missing those because he didn't need them so it wouldn't have made much sense for you guys to make those animations since you didn't need them Tongue
22-02-2012 04:03 AM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #13
RE: Editor - Creating Quests
by the way... easiest way to check what animations are available is to right-click on a sidekick (or its template) and open the sub-menu "Enable Effects". (Thats also usefull if you want to use the Lua-command "EnableEffect()" Wink)

[Image: ds18.jpg]
22-02-2012 10:23 AM
Find all posts by this user Quote this message in a reply
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #14
RE: Editor - Creating Quests
Thanks Smile

I messed around with sequences and doors/levers some more today. At first I was having trouble with a simple sequence where I was experimenting with CameraFocus() and CameraWaitFocus(). I was thinking CameraWaitFocus() makes the sequence function wait until the camera finishes its movement before it continues with the sequence code. But the CameraFocus() function always cut out after about a second. I figured out it was because I didn't have enough delay in my sequence function so the function was ending before the camera finished its movement.

As for doors/levers, I have a lever working now that opens a 2nd door. Though at first I had a problem with it not doing anything. Apparently you can't do a sequence in an object function because if I try to, then it simply does absolutely nothing at all. lol

I do have one little question though. I have 1 pentagram in my map that spawns 6-legged-beasts. The editor flags it as having an inconsistency saying "CmpSpawn 35769 seems to be a normal spawn and must have UseMaxLevelLimit turned on". I assume this is a bug in the editor because the pentagram does have UseMaxLevelLimit turned on, and the pentragram functions just fine in-game.
23-02-2012 01:17 PM
Find all posts by this user Quote this message in a reply
imi Offline
Realmforge Studios
******

Posts: 717
Joined: Mar 2010
Post: #15
RE: Editor - Creating Quests
Quote:Apparently you can't do a sequence in an object function

Ohyea.. that's a tricky one.

The object function is executed in the brain of the avatar who triggers the lever. If you start a sequence, the brains are deactivated. But if the brain is deactivated, it stops the current running brain script, so your very own function gets stoped immediately.

You can use the command "SpawnRootFunction" to spawn an independent lua function that kind-of "always executes, no matter what".

Also be sure to use "StartSequence()" without passing any parameter. (Read my comment on the luafunction overview about scary things that might happen otherwise Wink)

Quote:The editor flags it as having an inconsistency saying "CmpSpawn 35769 seems to be a normal spawn and must have UseMaxLevelLimit turned on"

Mh.. That's a complicated one.. The problem may be that in your GLOBAL_SETTINGS - object (the very first in the list), the "MaxLevel" property is set to something bigger than 5?

(This property in the global settings has nothing to do with the monster level. it comes from a very old feature, when the player could improve individuel spawn pentagrams up to 5 levels. During testing, the feature turned out to be annoying and too much micro-management, so we removed it - but apparently not completely Wink).

The max level of the spawn now serves another, but also very seldomly used purpose. You can have the spawn auto-level up after a certain amount of time (by putting the Type to TimeControlled). Using this in combination with tech-level-xml's, you can change properties of the spawn over time (e.g. change the spawned monster type and so on..)

All these special CmpSpawn - features are barely used in the main game and probably full with bugs, so better not use them. (In the end, you can also just change the spawn from lua after some timeout, which is much more flexible and probably more robust too. Wink)


(You can also just ignore the warning..)

[Image: ds18.jpg]
23-02-2012 02:46 PM
Find all posts by this user Quote this message in a reply
Megafont Offline
Junior Member
**

Posts: 10
Joined: Feb 2012
Post: #16
RE: Editor - Creating Quests
Thanks again for all the helpful info! Tongue

I checked my GameSettings object and the MaxSpawnLevel property was set to 20. So I changed it to 5 but it still gives me that warning about the spawner. lol
24-02-2012 01:20 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | kalypso media :: website | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication