Adventures Mod WIP

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

Adventures Mod WIP

by ashenk69 » Fri Jan 04, 2013 04:01

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.
 

User avatar
LorenzoVulcan
Member
 
Posts: 437
Joined: Mon Mar 12, 2012 06:46

by LorenzoVulcan » Mon Jan 07, 2013 09:52

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

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

by ashenk69 » Mon Jan 07, 2013 23:33

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 » Fri Jan 11, 2013 00:53

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: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Fri Jan 11, 2013 02:35

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 » Mon Jan 14, 2013 01:51

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 » Fri Jan 18, 2013 03:24

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

by jojoa1997 » Fri Jan 18, 2013 04:01

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 » Fri Jan 18, 2013 04:12

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

by jojoa1997 » Fri Jan 18, 2013 04:22

when i dig a no dig block i get this
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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 » Fri Jan 18, 2013 04:32

jojoa1997 wrote:when i dig a no dig block i get this
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Fri Jan 18, 2013 04:47

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 » Fri Jan 18, 2013 04:51

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

by jojoa1997 » Fri Jan 18, 2013 20:29

ashenk69 wrote:
jojoa1997 wrote:when i dig a no dig block i get this
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
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 » Fri Jan 18, 2013 22:58

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

by jojoa1997 » Fri Jan 18, 2013 23:01

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 » Fri Jan 18, 2013 23:17

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 » Sat Jan 19, 2013 17:40

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: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Sat Jan 19, 2013 18:05

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

by jojoa1997 » Sat Jan 19, 2013 19:17

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 » Sat Jan 19, 2013 19:20

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 » Sat Jan 19, 2013 19:23

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

by jojoa1997 » Sat Jan 19, 2013 22:37

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 » Tue Jan 22, 2013 01:21

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: 683
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Tue Jan 22, 2013 01:29

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
 

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

by ashenk69 » Tue Jan 22, 2013 01:56

@Chinchow

To account for your situation I need to include a way to initially define a quest. It doesn't even need to be the main quest. For example, it could be something like you start out somewhere deserted and you check your quest log and it tells you to go to town and speak with some guy. From there you might receive the actual main quest or another small quest. That is up to the designer of the map. I think I could fix this easily by actually just adding a boolean variable to define whether or not a quest should be an initial quest or a preceding one. This way you could define a couple of initial quests for the player. I know that didn't answer your question so much but more related I could make certain quests optional by adding another boolean variable for main or secondary.

This actually hasn't been too difficult so far. Github really helps with keeping track of what has changed and what needs to be changed.
 

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

by Chinchow » Tue Jan 22, 2013 02:12

Okay well keep up all the good work and can't wait till this mod is completely finished
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Tue Jan 22, 2013 02:57

How do you handle communication with NPC? With the recent modifications to Minetest, it is possible to use formspecs for "talking" to NPC or exchanging items. The trader in mobf works very fine. The same method would allow to click on pre-defined answers or type in something to talk to a specific NPC.
A list of my mods can be found here.
 

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

by ashenk69 » Tue Jan 22, 2013 03:33

Is the show_formspec function in 0.4.4 or is it only in one of the dev builds? I know I heard something about it but it isn't in the 0.4.4 api. Sometimes things haven' been documented yet. I might change over though to one of the dev builds because it is faster and it would allow for things like books, talking npc's, and a slew of other things I could use right now.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Tue Jan 22, 2013 03:43

It is in a recent dev build and was developed for the trader mob in mobf. Prior to that, it wasn't really possible to handle communications because formspecs couldn't be attached to lua entities like mobs. And formspecs on nodes where stored locally and could not be changed prior to display (i.e. a diffrent formspec for diffrent players wasn't possible). That has changed now. Thus I think that you might definitly be intrested in this new development :-) Have a look at the trader from mobf! Quests and interaction with mobs are the very things this is good for.
A list of my mods can be found here.
 

Next

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests

cron