Adventures Mod WIP

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

Adventures Mod WIP

by ashenk69 » Post

Currently a WIP. This mod will allow creation of things like quests, spawners, and areas to be defined in creative mode and later used in normal mode. It is really early in its development but I have most of the system completed. The version on github currently is stable enough to test but I assure you some of the newly added things will have little bugs here and there.
https://github.com/metalstache/adventures

All node affects do not take affect until you save and reload the world into normal mode.
The "`" character is used as a data separator for files. Don't include this in any test data if you don't want to have issues.

Nodes:
*The following nodes each define an area in creative mode to visually show which nodes are affected
Unbuildable - Building is prohibited
Unbreakable - Digging is prohibited
Fully Protected - Building and digging is prohibited
**The spawn system is currently just a random number drawn from the length of the list so if you define an area with blocks in it you might spawn inside a block
Spawn -New players initially spawn here
**The Checkpoint system uses IDs to distinguish the different points. To link a checkpoint with a respawn area just set the id the same as the checkpoint id. 0 is reserved for initial spawn and use positive increasing ids for standard purposes.
Respawn - Players respawn here
Checkpoint - Player IDs are changed once inside of the area. Don't be afraid to set this one a little bit larger than what you think. Just to ensure the ID is changed.

*These nodes have no area created in creative mode
Initial Stuff - Defines an inventory that will be used to give new players in normal mode their initial items.
Quest(Still Tweaking) - Defines a node where information like name, objectives, and descriptions are used to create quests.

Items:
Books(Still Tweaking) - Unique items that each have their own title and story. Players can read them by left clicking.
Quest Log(Unimplemented) - Opens a log of all quests the player has accepted.
Compass(Unimplemented) - Shows where the player needs to go for their active quest.

Commands in Creative mode:
/save = saves all relevant nodes and their data *Always do this before you quit the map otherwise nothing will be saved to files*
/books = opens menu for book editing

Image
Image
Last edited by ashenk69 on Sun Jan 27, 2013 04:52, edited 1 time in total.

LorenzoVulcan
Member
Posts: 447
Joined: Mon Mar 12, 2012 06:46
GitHub: aegroto

by LorenzoVulcan » Post

+1
Developer of the BlockForge 2# Project!
Official thread: http://minetest.net/forum/viewtopic.php ... 290#p54290

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

Some progress updates for everyone. I have successfully completed the part of the system that goes from creative mode to creative mode. Now I am working on going from creative mode to normal mode. This is where the system converts the information saved when in creative mode to tables that will be used in normal mode to define specific information.

This is a screenshot of an invincible node source. When a node source(the green node) is placed it also creates an entity(the area with corners defined) of a certain size with a position offset that is not clickable. Right now the areas can only be squares of any height because you can only set the x and y of the visual_size for an entity. I made it unclickable by setting collisionbox = 0 and adjusting visual_size of the entity.
Image

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

Now I have completed the phase of the system that goes from creative mode to normal mode. That means that you can define an invincible area in creative mode, call "/save" in the chat and it will save the information to files. Once in normal mode, the data saved to files is decoded into tables to check whether a node can be dug. The part I am working on now is going from normal mode to creative mode. The only thing I need to get working properly is setting the meta data of a node if it is placed by the system rather than the player. That's pretty easy though so hopefully I'll have a beta release for people to check out soon. The protection works like other protector mods so it has a familiar affect. Very little code is run after startup so this mod doesn't affect gameplay speed a lot.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

Keep up the good work and +1
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

The system is now complete. I can finally go through the whole cycle of the system and it does everything it is supposed to. Now that that is done, I am working on creating spawners for players. This will allow the creator to not only set where players will initially start at the beginning but also create checkpoints for when the player dies. The checkpoint system will have the spawners which will set the areas for players to respawn at and the checkpoints themselves which'll define when the player has reached a new checkpoint. Basically when a player reaches checkpoint 1 there respawn area is set to 1.

I am also working on making textures for everything. Areas(entities) have to have a black texture otherwise it turns from color to black when colliding with nodes.

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

Hello everyone, time for an update. I have completed the addition of spawns and checkpoints in the mod. This will allow builders to define areas for players to initially spawn and to also respawn. The spawn areas are for when a new player joins. Respawn areas are for ofcourse respawning. Respawning locations are controlled by IDs. Each checkpoint and respawn node has an id. When a player receives the id from the checkpoint then their respawn area is also set. This means players can also back track to a previous checkpoint and it will set their id to that previous checkpoint. If a respawn node's id is set to 0 then it will not add its positions to the system. I reserve 0 to be original spawn. There are also checks in there for if you don't supply a spawn area than the default one is chosen.

In the global file there are 4 important variables you can change depending on the behavior you want.
adventures.canBreak = Globally sets if the player can break blocks
adventures.canBuild = Same as canBreak except for building or placing blocks
adventures.autoSave = Wether or not the player checkpoint ids should be saved on intervals or only on system shutdown. Set to true is preferable in case the server shuts down unexpectedly.
adventures.saveTime = The time interval in which the player checkpoint ids are saved if autoSave is true.

Also textures I made with some of the default textures just so there is a difference for each node.

This is a stable release as far as I have tested it. I have been finding a few bugs here and there that I am trying to work out but it isn't anything game breaking. Next on my list is to make spawners for npcs or I might make an initial give stuff node to define what a player starts with.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

i can help with spawning mobs edit: why do black lines show up when i place the blocks. also how far do the blocks reach
Last edited by jojoa1997 on Fri Jan 18, 2013 04:08, edited 1 time in total.
Coding;
1X coding
3X debugging
12X tweaking to be just right

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

jojoa1997 wrote:i can help with spawning mobs edit: why do black lines show up when i place the blocks. also how far do the blocks reach
In creative mode the black lines are the GUI for which nodes will be affected so in a sense you can set it to a very large size but it is not suggested. You can edit the size and position by right clicking the source node.
Last edited by ashenk69 on Fri Jan 18, 2013 04:13, edited 1 time in total.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

when i dig a no dig block i get this

Code: Select all

LuaError: error: ...\bin\..\games\test_mods\mods\adventures/creative.lua:146: attempt to index a nil value
23:20:40: ERROR[main]: stack traceback:
23:20:40: ERROR[main]:     [C]: in function 'remove_node'
23:20:40: ERROR[main]:     ...netest-2013.01.14-61f5ca6b16\bin\..\builtin/item.lua:333: in function <...netest-2013.01.14-61f5ca6b16\bin\..\builtin/item.lua:299>
23:20:40: ERROR[main]:     (tail call): ?
Coding;
1X coding
3X debugging
12X tweaking to be just right

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

jojoa1997 wrote:when i dig a no dig block i get this

Code: Select all

LuaError: error: ...\bin\..\games\test_mods\mods\adventures/creative.lua:146: attempt to index a nil value
23:20:40: ERROR[main]: stack traceback:
23:20:40: ERROR[main]:     [C]: in function 'remove_node'
23:20:40: ERROR[main]:     ...netest-2013.01.14-61f5ca6b16\bin\..\builtin/item.lua:333: in function <...netest-2013.01.14-61f5ca6b16\bin\..\builtin/item.lua:299>
23:20:40: ERROR[main]:     (tail call): ?
I am not able to generate the same issue. I know what the issue could be but I can't recreate it by placing them down and digging them back up. I am also testing with the areas being in weird positions so I am not just testing them in the default spot. What mode were you in previously before you started the map and was an area there when you dug the node? If the area wasn't there then it would return a null pointer. That is why I am asking if there was anything you did outside of just placing and digging it.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

How about an update on what you have gotten done since the last update. I am very interested in your work
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

Chinchow wrote:How about an update on what you have gotten done since the last update. I am very interested in your work
This is what I have gotten done since the last update.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

ashenk69 wrote:
jojoa1997 wrote:when i dig a no dig block i get this

Code: Select all

LuaError: error: ...\bin\..\games\test_mods\mods\adventures/creative.lua:146: attempt to index a nil value
23:20:40: ERROR[main]: stack traceback:
23:20:40: ERROR[main]:     [C]: in function 'remove_node'
23:20:40: ERROR[main]:     ...netest-2013.01.14-61f5ca6b16\bin\..\builtin/item.lua:333: in function <...netest-2013.01.14-61f5ca6b16\bin\..\builtin/item.lua:299>
23:20:40: ERROR[main]:     (tail call): ?
I am not able to generate the same issue. I know what the issue could be but I can't recreate it by placing them down and digging them back up. I am also testing with the areas being in weird positions so I am not just testing them in the default spot. What mode were you in previously before you started the map and was an area there when you dug the node? If the area wasn't there then it would return a null pointer. That is why I am asking if there was anything you did outside of just placing and digging it.
i just placed and dug it. also i was in creative with damage on and this is the mod i had besides regular ones. lavasuit
Coding;
1X coding
3X debugging
12X tweaking to be just right

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

I pushed a new commit that adds a check when the node is dug to ensure there is an area found to be removed. jojoa1997, you probably won't be able to remove the node unless you delete my mod from your game go back into your world and then break it. Otherwise, it'll keep throwing that error. I also added infotext to ID blocks so you can view their ID without clicking on them. Currently working on initial stuff. If anyone knows how to use detached inventories help would be appreciated. I can't get the inventory to show in the node formspec.
Last edited by ashenk69 on Fri Jan 18, 2013 22:59, edited 1 time in total.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

ashenk69 wrote:I pushed a new commit that adds a check when the node is dug to ensure there is an area found to be removed. jojoa1997, you probably won't be able to remove the node unless you delete my mod from your game go back into your world and then break it. Otherwise, it'll keep throwing that error. I also added infotext to ID blocks so you can view their ID without clicking on them. Currently working on initial stuff. If anyone knows how to use detached inventories help would be appreciated. I can't get the inventory to show in the node formspec.
already deleted it. i will try the new one and look at the morechests mod. specifically the wifi one.
Coding;
1X coding
3X debugging
12X tweaking to be just right

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

jojoa1997 wrote:already deleted it. i will try the new one and look at the morechests mod. specifically the wifi one.
I checked out the wifi chest and the way he did it doesn't require or use detached inventories. I'm going to look at the bags mod. I think that used it.

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

After looking through the bags mod and the integrated part in unified inventory. I have successfully created a detached inventory for stuff to be given to the player when they first start. The reason for wanting to create a detached inventory over just a normal one was wanting to only have one place to edit it. Otherwise, there would be a lot of issues with which one should be saved. Right now nothing is actually given to you when you start normal mode but that won't be too difficult to add. This screenshot is of the initial stuff node. It has the same menu as a chest and the inventory slots will layout just like placing it in your normal inventory so the top bar is your hot bar. This way you can make a player start out holding a certain item or node.

Image

I am going to put some screenshots of some of the other nodes and their menus in the first post so people can see visually what I have done.

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

Do you get the items automatically or have to pick them up?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

can you explain how to use the individual blocks and what they do. also if you placed the blocks do you follow their rules
Coding;
1X coding
3X debugging
12X tweaking to be just right

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

Chinchow wrote:Do you get the items automatically or have to pick them up?
When a new player joins the game in normal mode it'll replace their inventory with what is defined in the detached inventory. Therefore nothing needs to be picked up.

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

jojoa1997 wrote:can you explain how to use the individual blocks and what they do. also if you placed the blocks do you follow their rules
I'll add a few explanations of what they do in the first post.

If I understand your question correctly. Your wondering if someone places one of the blocks are they effected by their affects? Yes, they are but the affects only happen in normal mode. When in creative mode they don't do anything other than allow you to modify them and saved to be used later in normal mode.

User avatar
jojoa1997
Member
Posts: 2890
Joined: Thu Dec 13, 2012 05:11
Location: Earth

by jojoa1997 » Post

i just realized this mod could be used to make an actual hunger games mod/server/game
Coding;
1X coding
3X debugging
12X tweaking to be just right

ashenk69
Member
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Post

After pondering for some time I finally have constructed a way that I think I can make quests. With the new quest node it will have a couple of parameters that you can set. Things like the name, objective and rewards. In normal mode it will tell you the needed information and you can either accept or decline the quest for whatever reasons. I am still not sure how to check whether the objective is complete but I am sure I can come up with a way to make it work. I am also thinking about integrating the compass mod along side the quest system so players will have a better understanding of where to go. This also means that there needs to be a way to simply know where a player needs to go. To do this I am going to use a method similar to my checkpoint system. A quest can have multiple points to go to so you can define multiple points with the same main id and then a sub id to signify their order.

Here are some screenshots of the new quest node's gui.
Image
Image

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Post

If they can decline a quest what about main quest
Example:
Main quest:kill the king
Side quest:steal the kings sword
Player declined main quest but took side quest see the point?
I understand you must be working hard already
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests

Post Reply

Who is online

Users browsing this forum: Trog and 9 guests