Savefile Character / Map Editor v1.0.1 (April 15, 2014)

Ask questions, share hints or chat in general about Eschalon: Book I.
User avatar
xolotl
Lieutenant
Lieutenant
Posts: 777
Joined: August 21st, 2008, 1:54 pm

Re: Savefile Character / Map Editor

Post by xolotl »

SpottedShroom wrote:Good to see you're still making improvements to the editor. Please allow me to make an unreasonable feature request. I'd love to see an API into the map interface, so that I could write code like this:
Heh, yeah, I'd love to see that stuff cleaned up, especially after having used the incredible pymclevel, a Python library for editing Minecraft worlds. I also noticed someone's thread asking for an "infinite dungeon generator," and got to thinking that it might be pretty fun to try and whip something up to do so.

You should be able to at least do some of what you want... One of the bigger problems would be having to deal with the coordinate system yourself, which isn't very intuitive or easy to work with. Your example code can be more-or-less replicated like so, btw:

Code: Select all

#!/usr/bin/python
# vim: set expandtab tabstop=4 shiftwidth=4:

from eschalon.map import Map
from eschalon.smartdraw import SmartDraw

# Constants
mapname = 'testing'
book = 1
FLOOR_BRICK = 53
WALL_BRICK = 181

# Initialize a blank map
# Note that despite the name "load", this doesn't actually load from
# disk yet - you'd have to call "m.read()" to actually do that.
m = Map.load('%s.map' % (mapname), book)
if book == 1:
    m.mapid = mapname

# Set this map as a "savegame" map, as opposed to a "global" map
m.set_savegame(True)

# Initialize our smartdraw system (for linking walls together)
sd = SmartDraw.new(book)
sd.set_map(m)

# Floor
for i in range(10, 21):
    for j in range(10, 21):
        m.squares[i][j].floorimg = FLOOR_BRICK

# Walls
for i in range(10, 20):
    for j in [10, 20]:
        m.squares[i][j].wall = 1
        m.squares[i][j].wallimg = WALL_BRICK
        sd.draw_wall(m.squares[i][j])
for i in [10, 20]:
    for j in range(10, 20):
        m.squares[i][j].wall = 1
        m.squares[i][j].wallimg = WALL_BRICK
        sd.draw_wall(m.squares[i][j])

# Write
m.write()
Apart from clearly not really being well-API'd, the big flaw there is that the coordinates don't really work like that, and you end up with a map that looks like:
The generated map
The generated map
testing.png (17.32 KiB) Viewed 10846 times
Not exactly ideal. A routine to draw a "straight" wall might look like:

Code: Select all

cur_y = 10
for x in range(10, 15):
    for y in [cur_y, cur_y+1]:
        m.squares[y][x].wall = 1
        m.squares[y][x].wallimg = WALL_BRICK
        sd.draw_wall(m.squares[y][x])
    cur_y += 2
So yeah, there's that for now, at least. Some digging through my probably-labyrinthine code might help as well.

I will see what I can do about cleaning all that up, providing some actually-useful API calls for walls and the like, integrating the smartdraw stuff, and providing actual documentation for it... That'll probably take a bit, though, and I probably won't target that until after 0.8.0.
User avatar
Minsk
Apprentice
Posts: 39
Joined: July 30th, 2011, 3:51 am
Location: Germany

Re: Savefile Character / Map Editor

Post by Minsk »

I just discovered this editor, great work !
Now i have two questions:

1. What does the "North Exit", "East Exit"...inside the "Global Map Properties" actually do ?

2. I had the idea to just create a very basic quest (go there and kill something) but cant see where to start. I know i need to place a person to talk with (to get the quest) but after i placed this person i dont know what to do, how can i add a quest to that person so i can talk to him and accept the quest and see it inside my quest-log ?

Oh, i already looked here but found no answers to my questions:
http://apocalyptech.com/eschalon/b1scripting.php
raverdave2k
Senior Council Member
Posts: 224
Joined: January 8th, 2012, 6:06 pm
Location: UK
Contact:

Re: Savefile Character / Map Editor

Post by raverdave2k »

Minsk wrote:I just discovered this editor, great work !
Now i have two questions:

1. What does the "North Exit", "East Exit"...inside the "Global Map Properties" actually do ?
The various exit properties decide what map you will arrive on when you walk off the matching edge of the screen.
Minsk wrote: 2. I had the idea to just create a very basic quest (go there and kill something) but cant see where to start. I know i need to place a person to talk with (to get the quest) but after i placed this person i dont know what to do, how can i add a quest to that person so i can talk to him and accept the quest and see it inside my quest-log ?

Oh, i already looked here but found no answers to my questions:
http://apocalyptech.com/eschalon/b1scripting.php
Unfortunately at the moment it is not possible to edit the npc dialog, in my mods I have dealt with adding quests to some degree using signs, letters etc to give instuctions using eith the message () or condition () functions.
My modifications for Eschalon Book I: RaverDave's Book I Mod
My modifications for Eschalon Book II: Port Kuudad Tower - Now Open, Treasure Of The Orakur

All previous versions avaliable here
User avatar
Minsk
Apprentice
Posts: 39
Joined: July 30th, 2011, 3:51 am
Location: Germany

Re: Savefile Character / Map Editor

Post by Minsk »

Thanks !

I hope this will be possible at some point...
Do you know what the .ent files do ?
There seems to be one for every map lile 35.ent.

Oh wait, that just the entities right ?
But what the locaton of the quest scripts then ?

Oh, and if i want to create my own map or dungeon, where would i start ?
Would i create a "new" global map, save it with some number and then just add a new map exit to it ?
So do i only need to edit a "Global Map" or is there something to do in "Savegame map file" mode ?
I hope you can understand what i mean with that, as you know there are two ways to load a map (from a Savegame & from the Data folder).

Thanks !
raverdave2k
Senior Council Member
Posts: 224
Joined: January 8th, 2012, 6:06 pm
Location: UK
Contact:

Re: Savefile Character / Map Editor

Post by raverdave2k »

You can create either a global or save game map, since I made my mod for Book I as a global one, but once I moved on to Book II I was forced to do it as a save game one due to changed in the game setup but I discovered that's actualy better as when creating a save game map you can define your own items, weapons, keys etc.

You will then need to edit one of the existing maps to give access to your new maps, either by setting one of the Exit's in the map properties or setting up a Map Link object on a teleporter, staircase, cave enterance etc.
My modifications for Eschalon Book I: RaverDave's Book I Mod
My modifications for Eschalon Book II: Port Kuudad Tower - Now Open, Treasure Of The Orakur

All previous versions avaliable here
User avatar
Minsk
Apprentice
Posts: 39
Joined: July 30th, 2011, 3:51 am
Location: Germany

Re: Savefile Character / Map Editor

Post by Minsk »

Thanks again.
Is there a special way i need to name my new map ?
Or can i just use "test" as name for example ?

And if i create a new "Save Game Map", can i just put it in the Data folder and use it as Global map ?
raverdave2k
Senior Council Member
Posts: 224
Joined: January 8th, 2012, 6:06 pm
Location: UK
Contact:

Re: Savefile Character / Map Editor

Post by raverdave2k »

You can name what the maps what you like, the originals use numbers (the grid ref of the tile) for external and a descriptive name for interior maps.

No you cant use global in save folders or vice versa.
My modifications for Eschalon Book I: RaverDave's Book I Mod
My modifications for Eschalon Book II: Port Kuudad Tower - Now Open, Treasure Of The Orakur

All previous versions avaliable here
User avatar
Minsk
Apprentice
Posts: 39
Joined: July 30th, 2011, 3:51 am
Location: Germany

Re: Savefile Character / Map Editor

Post by Minsk »

So you cant add your own items to a chest or define a key that will open a door while in Global Map mode ?
raverdave2k
Senior Council Member
Posts: 224
Joined: January 8th, 2012, 6:06 pm
Location: UK
Contact:

Re: Savefile Character / Map Editor

Post by raverdave2k »

Thats right, in global maps you only give a name for each item you put on a chest / draw etc and the game fills in the blanks from the built in data, if you use a custom name the item just appears as a widget.

In save game maps you define everything about the item so you can create what you like :)
My modifications for Eschalon Book I: RaverDave's Book I Mod
My modifications for Eschalon Book II: Port Kuudad Tower - Now Open, Treasure Of The Orakur

All previous versions avaliable here
User avatar
Minsk
Apprentice
Posts: 39
Joined: July 30th, 2011, 3:51 am
Location: Germany

Re: Savefile Character / Map Editor

Post by Minsk »

Ok, but you said that you cant copy a modified "Save Game Map" to the global maps.
Now i you would like to create a dungeon for other to play with you would need to give them the savegame file ?
So they will start playing with a new charakter (not their own) ?

Again, thanks for helping me, i already created a small working dungeon.
raverdave2k
Senior Council Member
Posts: 224
Joined: January 8th, 2012, 6:06 pm
Location: UK
Contact:

Re: Savefile Character / Map Editor

Post by raverdave2k »

You need to provide the .map and .ent files for any map you have edited these can then be copied into either a new or existing save game slot by any one wishing to play.

If you want to edit existing maps and distribute as save game maps you will need to start a new save game, head to the map in question and save as soon as you arrive without doing anything on the screen (killing anything, opening chests etc) copy that map out of your save game slot and work on it, then copy back in for testing.

In order to help with this I usually create a new game, save and then load up the starting map (Number 35) and add an object with the following script

Code: Select all

activate_qt 1 ; activate_qt 2 ; activate_qt 3 ; activate_qt 4 ; activate_qt 5 ; activate_qt 6 ; activate_qt 7 ; activate_qt 8
Then I reload the game and I can use the object I created (usually just a temporary sign on the wall) to activate all the quick travel points, this makes it a lot easier to navigate to the map you want in order to save a copy.
My modifications for Eschalon Book I: RaverDave's Book I Mod
My modifications for Eschalon Book II: Port Kuudad Tower - Now Open, Treasure Of The Orakur

All previous versions avaliable here
User avatar
Minsk
Apprentice
Posts: 39
Joined: July 30th, 2011, 3:51 am
Location: Germany

Re: Savefile Character / Map Editor

Post by Minsk »

Thats some useful informations, thanks !
I just have no idea how i could tell a story, give a quest, give the player the ability to make choices ect.

For example this command:

Code: Select all

narrative <narrativenum>
It looks like its impossible to detect if enemy x is dead for example.
Or lets say i want a message after the player has a special key, then i would use:

Code: Select all

cond_item (mykey) ; message (Quest complete !)
But where would you use that ?
Can you maybe provide examples how you tell a story, give quests ?

Thanks again !

Here is a screenshot from my quick test dungeon:
Image
raverdave2k
Senior Council Member
Posts: 224
Joined: January 8th, 2012, 6:06 pm
Location: UK
Contact:

Re: Savefile Character / Map Editor

Post by raverdave2k »

the narrative command is of no use to you as it can only be used to display the built in narrative text but the following code would procude the same result:

Code: Select all

sound (sfx_narration) ; message ("You enter a dark dungeon")
The above code could either be put at the end of the script that took you into the dungeon, or maybe on a floor activated script (Object Type 14), Book II also has a proximity object.

Each entity has a script field in there properties which is executed on there death which can be used to drop an item (orginal ones only), open a door / wall / portcullis or just display another message.

You can't officialy give a quest which would appear in the quest journal but you can create customer letters or books using the above narration script that would give details of the quest.

You can't execute script on collection of an object but using your example of a key, have that key open a door then on the otherside of that door have a floor trigger that displays the text and perhaps has a add_gold command to give a reward (there is a gain_xp command as well for Book II but sadly there does not appear to be a similar command for Book I)
My modifications for Eschalon Book I: RaverDave's Book I Mod
My modifications for Eschalon Book II: Port Kuudad Tower - Now Open, Treasure Of The Orakur

All previous versions avaliable here
User avatar
Minsk
Apprentice
Posts: 39
Joined: July 30th, 2011, 3:51 am
Location: Germany

Re: Savefile Character / Map Editor

Post by Minsk »

Will a custom letter display a real letter or just message text ?
Because i cant see how to create a real letter the player can read and click ok to close it.

About the key, i have already created a key but struggle in making i open a door...can you help ?
raverdave2k
Senior Council Member
Posts: 224
Joined: January 8th, 2012, 6:06 pm
Location: UK
Contact:

Re: Savefile Character / Map Editor

Post by raverdave2k »

No right clicking the later won't actually display the graphic on screen it will just display the text in the status area, you could try doing

Code: Select all

cond ("Random letter text here") (Ok) (Cancel)
As for the door, go it's properties and put the following in it's script

Code: Select all

unlocked_with (<key name>)
set it's lock level between 1 and 60 and it's sturdyness.

If you only want the door to be openable with the key then set lock level to 60 and untick destructable.
My modifications for Eschalon Book I: RaverDave's Book I Mod
My modifications for Eschalon Book II: Port Kuudad Tower - Now Open, Treasure Of The Orakur

All previous versions avaliable here
Post Reply