Creating maps - NEW!

You want to develop content? Create maps, items or quests! Get rewarded!

Moderator: Game Administrators

User avatar
compbatant
Site Admin
Posts: 1485
Joined: Fri Jun 15, 2012 12:00 am
Location: Warsaw, Poland
Contact:

Creating maps - NEW!

Post by compbatant » Fri Dec 13, 2019 4:14 pm

New maps can be created only on test server. To do it open settings in main menu and choose test server.
Test server have all accounts from the main server. The synchronization is made at least once a week.
Main server -> test server.
There is no synchronization in opposite direction.

There are 3 levels of map creating privileges:
  1. LEVEL 1: You can edit only visual look of your own map. To create your own map you need to be at level at least 50. You can create max 3 maps per account.I added this condition to prevent abuses.
  2. LEVEL 2: You can edit logic of your map. This means adding/editing portals, quests, chests, spawns, etc Special access need to be granted by me to your account. If you created nice looking map and tell me about it and I like it then you will get this privilege.
  3. LEVEL 3: You have access to your own copy of server and access to special version of PC client which can generate new textures. You can create new enemies, NPC, tiles, items. If you created great content in previous privilege level and you want to add new things to the game then I will grant you access to all stuff you need.
LEVEL 1

Enter in chat window this command to create your own map:

Code: Select all

 /map create
This will create map with standard size 10x10 .
To create with custom size use:

Code: Select all

/map create 3.3
Map can't be bigger than 10x10.
Now you can go to your map using command:

Code: Select all

 /map go
To go back to map 0.0 use the same command.
To start editing map use this:

Code: Select all

/e
You can have up to 3 own maps.
To go to particular map use:

Code: Select all

/map go 1
/map go 2
/map go 3
To delete map you need be on that map and then type:

Code: Select all

/map delete
You can give access to your map to other players. To do this go to your map and type:

Code: Select all

/map grant player_name
To remove access type:

Code: Select all

/map revoke player_name
Other player can enter your map by typing (on start map):

Code: Select all

/map go player_name
or

Code: Select all

/map go player_name map_number(1,2 or3)

After opening map editor with chat command "/e" you will see something like this:
Image
  1. The main menu.
    • After clicking the first button you exit edit mode.
    • Next button is for switching to tiles editor (this is opened by default).
    • Next button switches to map logic editor (you edit during this mode behavior not how the map looks) and the last button enters walking mode (without exiting editor). You need special access granted by me to see this button.
    • At the end you can see current clicked position.
  2. Here you can see tiles main categories (and also backgrounds). Click on one of them and you will see:
  3. tiles from current category. If you click on chosen one then the tile will be added to the game map in current position: position clicked on map not position where your characters is standing.
  4. Buttons for editing tiles.
    • First button is for erasing tile at specified position. If you are using PC version instead of using this button you can click right mouse button at specified point to remove tile.
    • Grid button for displaying size of all tiles added to the map.
    • Next button clears all tiles in current grid point. Grid is displayed in pink color.
    • Next button is for rotating current tile - not implemented yet.
    • Undo button removes last added tile. You can click it multiple times to remove last changes.
LEVEL 2

If you have access for editing map logic then after entering this mode you will see this window:
Image
In first row you can choose object type and then in second will appear the list of all objects of chosen type.
In the screenshot you can see that I chose enemies. Click chosen object to add it at current position.
Some objects like enemies, NPC are spawned when player enters 10x10 area between pink corners you can see on screenshot. These objects are displayed in yellow circle. The spawn position is random.
Other objects like portals, signs, switches markers have constant position and are placed exactly in the selected point.
You can click on added object and you will see context buttons. You can move the object, delete it or edit its parameters.
On the screen below you can see parameters for selected portal object which is teleport destination.
Image

Object you can add/edit:

Chest
Chest can be opened by player only once and one item is added to that player. Chest change texture after opening to indicate it was already opened.
The parameter for chest is just item ID. You can find all items IDs here: http://dmgamestudio.com/files/items.list


Portal
Portal teleports player to different location which can on other map or on the same map. Example parameters:
80.80
teleports to the position 80.80 at the same map
0.0.80.80
teleports to the map 0.0 at position 80.80


Shop
Example content:
0.9
0.7
3 6 60 61 8 9 10 11 12 23 24 25 50 51 52 53 54 55 56 57 58 59
First line is sell ratio, then buy ratio and then items which you can buy in this shop.
Each item has PRICE parameter which define base price. The first item in above shop is:

Code: Select all

3	3	WEAPON	Short Sword	DAMAGE:2 SPEED:5 SUBTYPE:SWORD LEVEL:0 PRICE:10
As you can see base price is 10. So this shops buy from player Short Sword for 7 (0.7 *10) and sell it to him for 9 (0.9*10)

Switch
Example content:
del 74.140 120 1
add 74.140 120 0
del 7.106 75 12
add 7.106 75 13
closed
del 74.140 120 0
add 74.140 120 1
del 7.106 75 13
add 7.106 75 12
The lines before "closed" are used in first state, the lines after "closed" in second state.
In the first line in our example word "del" means that tile 120_1 will be removed from position 74.120.
You can check tiles number by downloading http://dmgamestudio.com/files/ft7_dev.zip
Go to directory atlas_source/tiles_back/ to find tiles identifiers.

Smart NPC
Example content:
70.70 3 1 435
Smart NPC is NPC that walks to certain position, do some work and then go back. For example it fisherman who walks to X point, start fishing for Y time and then go back to
starting point. Another example is lumberjack which is defined in above example.
This lumberjack goes to position 70.70 and finds tree around at some random position. Then start chopping a tree for around 3 seconds and then change his skin to 435 and goes back
to starting position.
You can check skins IDs in entities.list file: http://dmgamestudio.com/ftmmorpg7/entities.list
Available work types:
MINING 0
FELLING 1
FISHING 2
BUILDING 3
So the parameters are:
destination_position work_time work_type walking_back_skin_id

Sign
This one is easy. It just contains text displayed as notification when you click on it.
Example:
Kedington village - West. Forester - North.

Quest NPC

Each NPC has it own file. The name of the file is the NPC id.
Example file:

Code: Select all

id 13

chat_npc Help! Help!
chat_me Calm down lad, tell me what happened.
chat_npc Those bandits assulted and robbed me, I hardly survived...
chat_me Where did they go?
chat_npc They went south. They stole my emerald jewel, a gift for my fiancée. I will pay you, if you retrieve it. It is a price less heirloom to me, it has been in my family for generations... 
quest_log Retrieve an emerald jewel from the bandits and bring it to the owner near the road sign


id 14

finish 13
needed_item 72

xp 50
gold 40
chat_npc Blessed be the spirits, you made it. I knew you would manage! Please take this.
First is unique quest id.
Then quest dialog and quest log.
Then next quest id and requirements for the that quest.
To start quest 14 you need first finish quest 13 and you must have item with id 72.
The prize for completing this quest is 50 experience points and 40 pieces of gold.
When server executes such quest file then it looks for first not yet finished quest where all conditions are fulfilled.
Look also at other quests to learn how to create your own.


Quests objects

Quests can be also attached to certain position on map not NPC which spawns in random position.
Look for example at file assets/quests/111.111.12.56 (door to the crypt in the pyramid)

Code: Select all

id 38

needed_item 112
teleport 112.112.13.6

id 39
notification You need a key to open the door.
If we have item 122 which is a key then teleport action to map 112.112 and location 13.6 is triggered.

Available quest commands:
xp - xp added after finishing quest
gold - gold added after finishing quest
item - item added after finishing quest
class_item - the same as above but only for certain hero class. Example: "class_item 694 WAND" . Classes are: SWORD, BOW, AXE, CLUB, WAND
needed_gold - minimum gold needed to start quest ( it will be taken by NPC)
needed_item - item needed to start quest ( it will be taken by NPC)
needed_item_return - item needed to start quest ( you don't loose it)
quest_log - specify message added to quest log
teleport - teleport player to specified destination
notification - display notification message
needed_level - specify minimum required level to start quest
needed_quest - specify quest needed to be finished before starting this quest
finish - the same as above but also close the quest log from that quest
not_finished_quest - the specified quest cannot be finished to start this quest
finish_any - only one of specified quests me be finished to continue. Example: "finish_any 121:413"
follow - create pet with specified id
needed_follower - you need to have pet with specified id to start quest
kill - kill all units with the specified id on this map ( with death animation)
remove - remove all units with specified id (disappear immediately)
create - create unit with specified id
jointeam - the NPC will join you as pet
leaveteam - detach pet with specified id
repeatable - after finishing quest don't add this quest id to the list of finished quest so you can trigger it again
needed_follower - here need to have pet with certain ID
start_kills - quest starts killing counter. Example: "start_kills 18 25" Hero need to kill 25 enemies with ID 18.
end_kills - quest is executed when we accomplished task from previously defined start_kills
for_testers - quest can be executed only by player who has tester status
daily - quest will be removed from finished quests list after day so player will be able to execute it once a day.
play_sound - play sound from client gamesounds directory
run_command - execute server command.

If you want to achieve something more complicated then you need to use scipts. Game scripts are written using groovy language.
Script should be inside special blocks: check, execute, end.
Here is example:

Code: Select all

id 9903
repeatable
check
  if ( hasFactor("outlaw") == true) {
      return true;
  }
  else {
      return false;
  }
execute
    teleport("0.3.52.40");
end
notification You are not allowed to enter the Spawn Event Map while in outlaw status.
The block between check and execute label is run first. If result is positive then the block
between "execute" and "end" is executed.
You can omit "check" or "execute" block if you don't need them.
In above example if player is outlawed then he is teleported to other map.
The methods you can use in script engine:
long getGold();

void addGold(long gold);

int getLevel();

boolean hasItem(int itemId);

boolean hasItem(ItemType itemType, ItemParam itemParam, int minimumValue);

void removeItem(ItemType itemType, ItemParam itemParam, int minimumValue);

int countItem(int itemId);

void removeItem(int itemId);

void addItem(int itemId);

void addXp(long xp);

WeaponType getWeaponType();

boolean isQuestFinished(int questId);

void finishQuest(int questId);

void resetQuest(int questId);

void markQuestFinished(int questId);

ArrayList<Integer> getFollowers();

void createEntity(int entityId);

void follow(int entityId);

void unfollow(int entityId);

void teleport(String destination);

void setFactor(String name, int value);

boolean hasFactor(String name);

int getFactor(String name);

ArrayList<QuestInterface> getNearPlayers(int range);

void changeFactor(String name, int value);

void playSound(String soundName);

void runCommand(String cmd);

void showNotification(String msg);

void showNotification(String msg, String param);

boolean hasTile(byte terrainId, byte tileId, V2d position);


LEVEL 3

To start your local version of server run in command line:
java -jar Server.jar
If you want to stop it press "ctrl+c"

Download development version of client from here:
http://dmgamestudio.com/files/ft7_dev.zip

In game settings choose server: local.
There is GM account set on this test server. Login: test, password: test

If you wan to add new graphics add it to appropriate folder in atlas_sources in your unzipped ft7_dev.
Next run from command line program:
prepare_textures.bat
It can take even few minutes to finish.

Objects/units

To add new object definition to the game you will need to add it to file entities.list in game client and units.json in server assets.
Entities.list defines only visual aspects of unit.
units.json defines parameters of unit
Here is example for Ice Troll. The line in entities.list for that units look like this:

Code: Select all

17 Unit Brown+Wolf matrix:0.5,0.5,0.5,0,0,0.5,0.5,0.5,0,0,0.5,0.5,0.5,0,0,0,0,0,1,0
First is unit unique ID, then name of texture. Optional parameter matrix is used to change texture colors.

The definition of this unit is units.json file look like this:

Code: Select all

  "17" : {
    "type" : "EnemyUnit",
    "name" : "Wolf",
    "size" : "1.1",
    "factors" : {
      "dexterity" : 1,
      "damage" : 2,
      "range" : 1,
      "frequency" : 1400,
      "xp_points" : 2,
      "max_life" : 20,
      "speed" : 9,
      "level" : 1
    },
    "drops" : [
      {
        "chance" : 1000,
        "itemId" : 63,
        "finishedQuest" : 3,
        "notFinishedQuest" : 4
      }
    ]
  }
First is ID which need to match the ID from entities.list
Then is unit type. Here is enemy. Size is 1.1
Then we have unit parameters called factors. It should be self explanatory.
Next we can see definition of items dropped if we kill that enemy.
Chance 1000 means 100%. For example 5 would be 0.5%
Optional parameter "finishedQuest" is used if enemy should drop only
if we finished certain quest and opposite parameter notFinishedQuest is used
if we didn't finish certain quest.

Tiles

The game map is built from tiles. Each tile contains graphic element like tree, rock, etc.
Tiles are defined in terrain.json file.
Tiles of similar type and the same size are stored in tile category called terrain.
You can find them in atlas_source/tiles_back directory
For example terrain id 70 stores two similar towers.
Definition for them look like this:

Code: Select all

    "70": {
      "size": "2.6",
      "type": 0,
      "walkingCost": 127      
      "tiles": {
        "0": {
          "obstacleMask": "111133330000"
        },
        "1": {
          "obstacleMask": "111133330000"
        }
      }
    }
First is size which is 2x6. The smallest tile which is 1x1 equals 32x32 pixels. So here is 64 width and 192 pixels height.
Type can be 0 - obstacle, 1 - ground, 2 - water.
Obstacle is default so you don't need to explicit put this parameter in obstacle terrain definition.
For grounds you can define walkingCost. Smaller number causes units to prefer walking on this tile instead of others. This is useful for tiles containing paths, roads, etc.
Next are definition for certain tiles from current terrain category.
obstacleMask defines which part of tile is displayed behind player, which one in front of player. which part is obstacle and which not (you can walk).
I will explain it later. TO BE CONTINUED.

Items

Items are defined in items.list file in both client and server assets. These files should be the same.
Example line from that file:

Code: Select all

10 10 WEAPON Axe DAMAGE:7 SPEED:7 SUBTYPE:AXE LEVEL:2 PRICE:100
First field is item id which must be unique. Next is item icon number. Item icons you can find in atlas_source/gui/
Next field is item type, item name, item parameters. All fields are separated by tabulators except
for item parameters which are separated by space.
You can also add item description as the last not mandatory field.


Crafting

Crafting is defined in craft.list in server assets.
Example line:
normal_high,great_forge 70 1000 258:3
First is category. We have currently 6 categories:
normal, normal_high, magic, magic_high, siege, special.
Next line defines building needed to craft that item or quest you had to finish before you can craft this item.
We have:
laboratory, great_laboratory, forge, great_forge, workshop
You can check in units.json file that for example blue castle provides:
craft forge laboratory workshop
Next parameter in every craft.list line is crafting item ID. Here is 70 which is Carbon Ingot. Next crafting chance. 1000 = 100%
After this there are ingredients. Here are 3 x item 258 which is Carbon Ore. Items IDs you will find in items.list file.
WARBRINGER
Posts: 491
Joined: Sun Dec 04, 2016 8:47 pm
Location: Hampshire, England

Re: Creating maps - NEW!

Post by WARBRINGER » Fri Jan 03, 2020 3:26 pm

I've finished my map to the best of my extent - would appreciate some feedback and eventually, when I have time, access to the second level of development tools.
As before, the account name is 'BlackBows' and I am now working on interiors for the dungeon, the houses, and the palace.

However, my client version is 7.6.1 or later and I still don't have access to the missing files! (Such as the watermill, moving plants, et cetera!) :(
WARBRINGER [raw][Very Hungry Ogre]
BlackBows [rod][Archer]
Echoes :twisted: [Duke of NTL][Sword]
Black Rose [AD][Mage]
User avatar
madmaniacal1
Posts: 1540
Joined: Mon May 23, 2016 12:29 am

Re: Creating maps - NEW!

Post by madmaniacal1 » Fri Jan 03, 2020 6:17 pm

WARBRINGER wrote:
Fri Jan 03, 2020 3:26 pm
I've finished my map to the best of my extent - would appreciate some feedback and eventually, when I have time, access to the second level of development tools.
As before, the account name is 'BlackBows' and I am now working on interiors for the dungeon, the houses, and the palace.

However, my client version is 7.6.1 or later and I still don't have access to the missing files! (Such as the watermill, moving plants, et cetera!) :(
Moving entities, quest making, and spawns are all limited to level 2 on test server. Creating new monsters requires local server access (level 3).
Have you begun writing your quests yet? I find that typing them up separately and later pasting them into my quest file on map is much easier than trying to do it all ingame. I'd love the opportunity to help you until you have the access yourself, if you like.
Omnes Autem Uri
WARBRINGER
Posts: 491
Joined: Sun Dec 04, 2016 8:47 pm
Location: Hampshire, England

Re: Creating maps - NEW!

Post by WARBRINGER » Sat Jan 04, 2020 11:06 am

madmaniacal1 wrote:
Fri Jan 03, 2020 6:17 pm
WARBRINGER wrote:
Fri Jan 03, 2020 3:26 pm
I've finished my map to the best of my extent - would appreciate some feedback and eventually, when I have time, access to the second level of development tools.
As before, the account name is 'BlackBows' and I am now working on interiors for the dungeon, the houses, and the palace.

However, my client version is 7.6.1 or later and I still don't have access to the missing files! (Such as the watermill, moving plants, et cetera!) :(
Moving entities, quest making, and spawns are all limited to level 2 on test server. Creating new monsters requires local server access (level 3).
Have you begun writing your quests yet? I find that typing them up separately and later pasting them into my quest file on map is much easier than trying to do it all ingame. I'd love the opportunity to help you until you have the access yourself, if you like.
Hey, MadMan :)

I haven't yet begun working on them, as have been busy with Christmas + Girlfriend + New Year's etc. I figured I'd get access to the level 2 test server and slowly work my way through it as and when I can, but perhaps I will type them up! Thank you :)
WARBRINGER [raw][Very Hungry Ogre]
BlackBows [rod][Archer]
Echoes :twisted: [Duke of NTL][Sword]
Black Rose [AD][Mage]
User avatar
LostKnight
Posts: 5095
Joined: Sat Sep 09, 2017 8:02 pm
Location: Rockheim nord i Steinheim nær Kedington

Re: Creating maps - NEW!

Post by LostKnight » Thu Jan 09, 2020 3:09 pm

On Linux = FT v7.6.1

Just tried:

Code: Select all

/map create
/map go
Nothing.

Do this work with this version of FT?

EDIT: Never mind it must have been a typo!
The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
How to Submit a Report to the GM Inbox
-Robarlll-
Posts: 4
Joined: Sat Jan 05, 2019 10:30 am

Re: Creating maps - NEW!

Post by -Robarlll- » Sat Feb 22, 2020 11:23 am

Хотелось бы больше квестов на 500лвл которые помогают в прокачки просто на 500лвл игроки вынуждены донатить на петомцев или квест с питомцами что давали по сильней а так же хотелось бы что бы добавили ещё один клас середину между классами всеми что бы можно было использовать почти все способности других или какое нибудь зелье или заклинание так же можно добавить оглушение магу как заклинание или выбор оглушение сферой или книгой было бы неплохо а другим нанесение яда на оружие что бы при отравление не работали скилы и способности какое время было бы неплохо если бы за хорошее поведение и помощи гм давали амнистию на мут и тюрьму просто я донатил на акаунт и не все правила знал на то время сейчас веду себя исправно помогаю новым игрокам и вообще помогать стараюсь людям в игре не зависимо от расы и нацанальности с кем могу говорить и понимаю подумайте над этим а ещё хотелось бы что бы добавили лучникам колчан с стрелами а так же магам какой нибудь магический шар или сверу или книгу что бы закрыть пустой слот и штаны или лёгкие шёрты так же хотел бы видеть скин ангела души с ванштэйна
User avatar
SellSword
Posts: 3027
Joined: Tue Aug 29, 2017 11:16 pm
Location: Ardesia

Re: Creating maps - NEW!

Post by SellSword » Sat Feb 22, 2020 5:38 pm

Good for a suggestion thread
Warriors are not the ones who always win, but the ones that always fight.
User avatar
Dark-Lord
Posts: 2
Joined: Sun Mar 03, 2019 12:52 am

Re: Creating maps - NEW!

Post by Dark-Lord » Thu Mar 05, 2020 12:55 pm

BANK       when go inside bank building u teleport here
BANK when go inside bank building u teleport here
Screenshot_20200304-143753_Forgotten Tales.jpg (1.55 MiB) Viewed 22053 times
BANK       when go inside bank building u teleport here
BANK when go inside bank building u teleport here
Screenshot_20200304-143753_Forgotten Tales.jpg (1.55 MiB) Viewed 22053 times
compbatant wrote:
Fri Dec 13, 2019 4:14 pm
New maps can be created only on test server. To do it open settings in main menu and choose test server.
Test server have all accounts from the main server. The synchronization is made at least once a week.
Main server -> test server.
There is no synchronization in opposite direction.

There are 3 levels of map creating privileges:
  1. LEVEL 1: You can edit only visual look of your own map. To create your own map you need to be at level at least 50. You can create max 3 maps per account.I added this condition to prevent abuses.
  2. LEVEL 2: You can edit logic of your map. This means adding/editing portals, quests, chests, spawns, etc Special access need to be granted by me to your account. If you created nice looking map and tell me about it and I like it then you will get this privilege.
  3. LEVEL 3: You have access to your own copy of server and access to special version of PC client which can generate new textures. You can create new enemies, NPC, tiles, items. If you created great content in previous privilege level and you want to add new things to the game then I will grant you access to all stuff you need.
LEVEL 1

Enter in chat window this command to create your own map:

Code: Select all

 /map create
This will create map with standard size 10x10 .
To create with custom size use:

Code: Select all

/map create 3.3
Map can't be bigger than 10x10.
Now you can go to your map using command:

Code: Select all

 /map go
To go back to map 0.0 use the same command.
To start editing map use this:

Code: Select all

/e
You can have up to 3 own maps.
To go to particular map use:

Code: Select all

/map go 1
/map go 2
/map go 3
To delete map you need be on that map and then type:

Code: Select all

/map delete
You can give access to your map to other players. To do this go to your map and type:

Code: Select all

/map grant player_name
To remove access type:

Code: Select all

/map revoke player_name
Other player can enter your map by typing (on start map):

Code: Select all

/map go player_name
or

Code: Select all

/map go player_name map_number(1,2 or3)

After opening map editor with chat command "/e" you will see something like this:
Image
  1. The main menu.
    • After clicking the first button you exit edit mode.
    • Next button is for switching to tiles editor (this is opened by default).
    • Next button switches to map logic editor (you edit during this mode behavior not how the map looks) and the last button enters walking mode (without exiting editor). You need special access granted by me to see this button.
    • At the end you can see current clicked position.
  2. Here you can see tiles main categories (and also backgrounds). Click on one of them and you will see:
  3. tiles from current category. If you click on chosen one then the tile will be added to the game map in current position: position clicked on map not position where your characters is standing.
  4. Buttons for editing tiles.
    • First button is for erasing tile at specified position. If you are using PC version instead of using this button you can click right mouse button at specified point to remove tile.
    • Grid button for displaying size of all tiles added to the map.
    • Next button clears all tiles in current grid point. Grid is displayed in pink color.
    • Next button is for rotating current tile - not implemented yet.
    • Undo button removes last added tile. You can click it multiple times to remove last changes.
LEVEL 2

If you have access for editing map logic then after entering this mode you will see this window:
Image
In first row you can choose object type and then in second will appear the list of all objects of chosen type.
In the screenshot you can see that I chose enemies. Click chosen object to add it at current position.
Some objects like enemies, NPC are spawned when player enters 10x10 area between pink corners you can see on screenshot. These objects are displayed in yellow circle. The spawn position is random.
Other objects like portals, signs, switches markers have constant position and are placed exactly in the selected point.
You can click on added object and you will see context buttons. You can move the object, delete it or edit its parameters.
On the screen below you can see parameters for selected portal object which is teleport destination.
Image

Object you can add/edit:

Chest
Chest can be opened by player only once and one item is added to that player. Chest change texture after opening to indicate it was already opened.
The parameter for chest is just item ID. You can find all items IDs here: http://dmgamestudio.com/files/items.list


Portal
Portal teleports player to different location which can on other map or on the same map. Example parameters:
80.80
teleports to the position 80.80 at the same map
0.0.80.80
teleports to the map 0.0 at position 80.80


Shop
Example content:
0.9
0.7
3 6 60 61 8 9 10 11 12 23 24 25 50 51 52 53 54 55 56 57 58 59
First line is sell ratio, then buy ratio and then items which you can buy in this shop.
Each item has PRICE parameter which define base price. The first item in above shop is:

Code: Select all

3	3	WEAPON	Short Sword	DAMAGE:2 SPEED:5 SUBTYPE:SWORD LEVEL:0 PRICE:10
As you can see base price is 10. So this shops buy from player Short Sword for 7 (0.7 *10) and sell it to him for 9 (0.9*10)

Switch
Example content:
del 74.140 120 1
add 74.140 120 0
del 7.106 75 12
add 7.106 75 13
closed
del 74.140 120 0
add 74.140 120 1
del 7.106 75 13
add 7.106 75 12
The lines before "closed" are used in first state, the lines after "closed" in second state.
In the first line in our example word "del" means that tile 120_1 will be removed from position 74.120.
You can check tiles number by downloading http://dmgamestudio.com/files/ft7_dev.zip
Go to directory atlas_source/tiles_back/ to find tiles identifiers.

Smart NPC
Example content:
70.70 3 1 435
Smart NPC is NPC that walks to certain position, do some work and then go back. For example it fisherman who walks to X point, start fishing for Y time and then go back to
starting point. Another example is lumberjack which is defined in above example.
This lumberjack goes to position 70.70 and finds tree around at some random position. Then start chopping a tree for around 3 seconds and then change his skin to 435 and goes back
to starting position.
You can check skins IDs in entities.list file: http://dmgamestudio.com/ftmmorpg7/entities.list
Available work types:
MINING 0
FELLING 1
FISHING 2
BUILDING 3
So the parameters are:
destination_position work_time work_type walking_back_skin_id

Sign
This one is easy. It just contains text displayed as notification when you click on it.
Example:
Kedington village - West. Forester - North.

Quest NPC

Each NPC has it own file. The name of the file is the NPC id.
Example file:

Code: Select all

id 13

chat_npc Help! Help!
chat_me Calm down lad, tell me what happened.
chat_npc Those bandits assulted and robbed me, I hardly survived...
chat_me Where did they go?
chat_npc They went south. They stole my emerald jewel, a gift for my fiancée. I will pay you, if you retrieve it. It is a price less heirloom to me, it has been in my family for generations... 
quest_log Retrieve an emerald jewel from the bandits and bring it to the owner near the road sign


id 14

finish 13
needed_item 72

xp 50
gold 40
chat_npc Blessed be the spirits, you made it. I knew you would manage! Please take this.
First is unique quest id.
Then quest dialog and quest log.
Then next quest id and requirements for the that quest.
To start quest 14 you need first finish quest 13 and you must have item with id 72.
The prize for completing this quest is 50 experience points and 40 pieces of gold.
When server executes such quest file then it looks for first not yet finished quest where all conditions are fulfilled.
Look also at other quests to learn how to create your own.


Quests objects

Quests can be also attached to certain position on map not NPC which spawns in random position.
Look for example at file assets/quests/111.111.12.56 (door to the crypt in the pyramid)

Code: Select all

id 38

needed_item 112
teleport 112.112.13.6

id 39
notification You need a key to open the door.
If we have item 122 which is a key then teleport action to map 112.112 and location 13.6 is triggered.

Available quest commands:
xp - xp added after finishing quest
gold - gold added after finishing quest
item - item added after finishing quest
class_item - the same as above but only for certain hero class. Example: "class_item 694 WAND" . Classes are: SWORD, BOW, AXE, CLUB, WAND
needed_gold - minimum gold needed to start quest ( it will be taken by NPC)
needed_item - item needed to start quest ( it will be taken by NPC)
needed_item_return - item needed to start quest ( you don't loose it)
quest_log - specify message added to quest log
teleport - teleport player to specified destination
notification - display notification message
needed_level - specify minimum required level to start quest
needed_quest - specify quest needed to be finished before starting this quest
finish - the same as above but also close the quest log from that quest
not_finished_quest - the specified quest cannot be finished to start this quest
finish_any - only one of specified quests me be finished to continue. Example: "finish_any 121:413"
follow - create pet with specified id
needed_follower - you need to have pet with specified id to start quest
kill - kill all units with the specified id on this map ( with death animation)
remove - remove all units with specified id (disappear immediately)
create - create unit with specified id
jointeam - the NPC will join you as pet
leaveteam - detach pet with specified id
repeatable - after finishing quest don't add this quest id to the list of finished quest so you can trigger it again
needed_follower - here need to have pet with certain ID
start_kills - quest starts killing counter. Example: "start_kills 18 25" Hero need to kill 25 enemies with ID 18.
end_kills - quest is executed when we accomplished task from previously defined start_kills
for_testers - quest can be executed only by player who has tester status
daily - quest will be removed from finished quests list after day so player will be able to execute it once a day.
play_sound - play sound from client gamesounds directory
run_command - execute server command.

If you want to achieve something more complicated then you need to use scipts. Game scripts are written using groovy language.
Script should be inside special blocks: check, execute, end.
Here is example:

Code: Select all

id 9903
repeatable
check
  if ( hasFactor("outlaw") == true) {
      return true;
  }
  else {
      return false;
  }
execute
    teleport("0.3.52.40");
end
notification You are not allowed to enter the Spawn Event Map while in outlaw status.
The block between check and execute label is run first. If result is positive then the block
between "execute" and "end" is executed.
You can omit "check" or "execute" block if you don't need them.
In above example if player is outlawed then he is teleported to other map.
The methods you can use in script engine:
long getGold();

void addGold(long gold);

int getLevel();

boolean hasItem(int itemId);

boolean hasItem(ItemType itemType, ItemParam itemParam, int minimumValue);

void removeItem(ItemType itemType, ItemParam itemParam, int minimumValue);

int countItem(int itemId);

void removeItem(int itemId);

void addItem(int itemId);

void addXp(long xp);

WeaponType getWeaponType();

boolean isQuestFinished(int questId);

void finishQuest(int questId);

void resetQuest(int questId);

void markQuestFinished(int questId);

ArrayList<Integer> getFollowers();

void createEntity(int entityId);

void follow(int entityId);

void unfollow(int entityId);

void teleport(String destination);

void setFactor(String name, int value);

boolean hasFactor(String name);

int getFactor(String name);

ArrayList<QuestInterface> getNearPlayers(int range);

void changeFactor(String name, int value);

void playSound(String soundName);

void runCommand(String cmd);

void showNotification(String msg);

void showNotification(String msg, String param);

boolean hasTile(byte terrainId, byte tileId, V2d position);


LEVEL 3

To start your local version of server run in command line:
java -jar Server.jar
If you want to stop it press "ctrl+c"

Download development version of client from here:
http://dmgamestudio.com/files/ft7_dev.zip

In game settings choose server: local.
There is GM account set on this test server. Login: test, password: test

If you wan to add new graphics add it to appropriate folder in atlas_sources in your unzipped ft7_dev.
Next run from command line program:
prepare_textures.bat
It can take even few minutes to finish.

Objects/units

To add new object definition to the game you will need to add it to file entities.list in game client and units.json in server assets.
Entities.list defines only visual aspects of unit.
units.json defines parameters of unit
Here is example for Ice Troll. The line in entities.list for that units look like this:

Code: Select all

17 Unit Brown+Wolf matrix:0.5,0.5,0.5,0,0,0.5,0.5,0.5,0,0,0.5,0.5,0.5,0,0,0,0,0,1,0
First is unit unique ID, then name of texture. Optional parameter matrix is used to change texture colors.

The definition of this unit is units.json file look like this:

Code: Select all

  "17" : {
    "type" : "EnemyUnit",
    "name" : "Wolf",
    "size" : "1.1",
    "factors" : {
      "dexterity" : 1,
      "damage" : 2,
      "range" : 1,
      "frequency" : 1400,
      "xp_points" : 2,
      "max_life" : 20,
      "speed" : 9,
      "level" : 1
    },
    "drops" : [
      {
        "chance" : 1000,
        "itemId" : 63,
        "finishedQuest" : 3,
        "notFinishedQuest" : 4
      }
    ]
  }
First is ID which need to match the ID from entities.list
Then is unit type. Here is enemy. Size is 1.1
Then we have unit parameters called factors. It should be self explanatory.
Next we can see definition of items dropped if we kill that enemy.
Chance 1000 means 100%. For example 5 would be 0.5%
Optional parameter "finishedQuest" is used if enemy should drop only
if we finished certain quest and opposite parameter notFinishedQuest is used
if we didn't finish certain quest.

Tiles

The game map is built from tiles. Each tile contains graphic element like tree, rock, etc.
Tiles are defined in terrain.json file.
Tiles of similar type and the same size are stored in tile category called terrain.
You can find them in atlas_source/tiles_back directory
For example terrain id 70 stores two similar towers.
Definition for them look like this:

Code: Select all

    "70": {
      "size": "2.6",
      "type": 0,
      "walkingCost": 127      
      "tiles": {
        "0": {
          "obstacleMask": "111133330000"
        },
        "1": {
          "obstacleMask": "111133330000"
        }
      }
    }
First is size which is 2x6. The smallest tile which is 1x1 equals 32x32 pixels. So here is 64 width and 192 pixels height.
Type can be 0 - obstacle, 1 - ground, 2 - water.
Obstacle is default so you don't need to explicit put this parameter in obstacle terrain definition.
For grounds you can define walkingCost. Smaller number causes units to prefer walking on this tile instead of others. This is useful for tiles containing paths, roads, etc.
Next are definition for certain tiles from current terrain category.
obstacleMask defines which part of tile is displayed behind player, which one in front of player. which part is obstacle and which not (you can walk).
I will explain it later. TO BE CONTINUED.

Items

Items are defined in items.list file in both client and server assets. These files should be the same.
Example line from that file:

Code: Select all

10 10 WEAPON Axe DAMAGE:7 SPEED:7 SUBTYPE:AXE LEVEL:2 PRICE:100
First field is item id which must be unique. Next is item icon number. Item icons you can find in atlas_source/gui/
Next field is item type, item name, item parameters. All fields are separated by tabulators except
for item parameters which are separated by space.
You can also add item description as the last not mandatory field.


Crafting

Crafting is defined in craft.list in server assets.
Example line:
normal_high,great_forge 70 1000 258:3
First is category. We have currently 6 categories:
normal, normal_high, magic, magic_high, siege, special.
Next line defines building needed to craft that item or quest you had to finish before you can craft this item.
We have:
laboratory, great_laboratory, forge, great_forge, workshop
You can check in units.json file that for example blue castle provides:
craft forge laboratory workshop
Next parameter in every craft.list line is crafting item ID. Here is 70 which is Carbon Ingot. Next crafting chance. 1000 = 100%
After this there are ingredients. Here are 3 x item 258 which is Carbon Ore. Items IDs you will find in items.list file.
WARBRINGER
Posts: 491
Joined: Sun Dec 04, 2016 8:47 pm
Location: Hampshire, England

Re: Creating maps - NEW!

Post by WARBRINGER » Thu Mar 05, 2020 7:36 pm

Hmm.. can't seem to log on when I have the test server selected :roll: Any ideas? P.S. My WiFi connection is okay, and I also have access to the main game!
WARBRINGER [raw][Very Hungry Ogre]
BlackBows [rod][Archer]
Echoes :twisted: [Duke of NTL][Sword]
Black Rose [AD][Mage]
James142
Posts: 581
Joined: Tue Mar 11, 2014 4:12 am

Re: Creating maps - NEW!

Post by James142 » Thu Mar 05, 2020 10:04 pm

WARBRINGER wrote:
Thu Mar 05, 2020 7:36 pm
Hmm.. can't seem to log on when I have the test server selected :roll: Any ideas? P.S. My WiFi connection is okay, and I also have access to the main game!
The map your character is on may be crashed, try with another character.
The OG Rasta

“Victorious warriors win first and then go to war, while defeated warriors go to war first and then seek to win”
Post Reply