Nod Engine SDK > Mapping in Embrace

[Video Tutorial] Layers & Scenes

(1/2) > >>

Javokis:
I just finished another tutorial. This time on the long awaited scenes and layers. This 3 part tutorial will teach you how to work with layers and create custom scenes for your map.

[youtube=605,409]http://www.youtube.com/watch?v=wsGczK6KmaY&feature=PlayList&p=4ED1E193E87CD31E&index=0[/youtube]

[youtube=605,409]http://www.youtube.com/watch?v=5NUOv1paWu0&feature=PlayList&p=4ED1E193E87CD31E&index=1[/youtube]

[youtube=605,409]http://www.youtube.com/watch?v=A02LSGNvf9U&feature=PlayList&p=4ED1E193E87CD31E&index=2[/youtube]

I'm sure some of you are saying, "Well, it's about time!"

Enjoy!

Barnabas:
What I really do not understand, is that stuff with the layers. Are layers only a maptool to make the map a little bit more clearly, when you are able to let some stuff of the layer disappear? Or do layers let the connected stuff appear and disappear ingame as well? I yes, how do that work to change between the layers ingame?

Javokis:
Layers are assigned to a scene (nsd file) that was covered in the tutorial.

You need to have layers to make a custom scene.

Changing scenes through in-game actions require knowledge in java and programming logic. Or some patience to wait till I get around to making some generic Codex Linker scripts that allow scene change.

Barnabas:
At the moment I´m standing in front of a problem:

I added some conversations to my maps, to make my maps more alive, but I want the NPC to remember the player, that talked to them yet, so that the NPCs use another conversation, when the player returns to them. I could imagine, that I have place a NPC in different layers and every NPC in the different layers uses another confersation file. If this is true, how do I activate the other layer after the first conversation? Which command do I have to add to my conversationstart .java/.class file?

Javokis:
You want them to remember who spoke to them... like individually... as a party and/or as in MP?

There are several ways to do that in java. Could use a vector or array variable stored at a module level that stores a player's ID (array recommended since vectors can't be saved all that easily). I think I did something like this with my Club Abla scripts, which I think I included source code in MoTA.

Loading scenes would be easier, but you still need to have a grasp of java and how to use variable storage and condition checking. The pre-built scripts I included with my tutorials only have basic functions so you're still left with studying code to add new features.

So in a nutshell, your question steps into the realm of programming logic. I'll give you a basic idea of how you might code that:


--- Code: ---private String convos[]   =  {"convo1", "convo2", "convo3"}; //where this is the convo NAME in the nco file
private int playerspoke[]  = new int[8]; //Since the MP game is limited to maximum of 8 players.
private int playerconvoflag[] = new int[8]; //All players start at convo 0... assuming this is initialized :/

--- End code ---

Conditions can be a bit more complicated but using this set of variables could give you an idea on what to put at module level. I haven't coded in long while like this so bare with me. Here's what you could do with these variables:

When the player clicks:


--- Code: ---//Start with a search for the player in the array
for(int i = 0;i < playerspoke.length;i++){
  //If the player was found then run the convo for the player
  if(playerspoke[i] == clicker.GetGUID()){
    //Here's where the convo name is used from the convo file name (nco)
    ExecuteConversation(clicker.GetGUID(), clicked.GetGUID(), convos[playerconvoflag[i]], "MyConvo.nco", CONV_XFLAG_WANTFEEDBACK);
    //Increment to the next conversation for that player
    //Make sure the convo flag doesn't exceed the number of convos
    if(playerconvoflag[i] < convos.length)
      playerconvoflag[i] += 1; //++ might blow up in 1.1.8 java for an array not initialized.
  }
}
--- End code ---

This is a pretty flawed script but should give you a good idea of what Java can allow. This is only an idea script and shouldn't be plugged into you code unless you know what it I'm missing. This is not enough to make things work. There's still missing initializers and logic errors, but should give you a basic idea of what you can do.

Hope this helps. ;)

Navigation

[0] Message Index

[#] Next page

Go to full version