Jump to content
The Dark Mod Forums

Apples and Peaches: Obsttorte's Mapping and Scripting Thread


Obsttorte

Recommended Posts

Do you want this discussion here in this thread, or would you like to create a new thread to discuss it in more detail?

http://forums.thedarkmod.com/topic/14788-security-level-system/

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

  • 3 months later...

There is a file called "mainmenu_objectives.gui" included in the main mod, which controlls the appearence of the objectives screen in the main menu. However, a comment at the beginning of this file says, that it should not be modified.

 

Actually, I just did that and couldn't see any problems with that.

 

So my question is: Is this just a general advice as some changes may cause problems, or do I oversee something? To be more clearly, I changed the appearence of the icons in front of the objectives (the checkboxes).

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

So my question is: Is this just a general advice as some changes may cause problems, or do I oversee something?

 

I think it's just general advice.

Link to comment
Share on other sites

I was able to improve my automap a bit. The pk4 linked below is a little demonstration. Beneath the fact that I've used pictures this time, I was able to easen the setup fairly. I hope you like it.

 

http://www.mediafire.com/download/rketfh821f677rj/automap.pk4

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

UPDATE: AUTOMAP

 

Finally I was able to easen the setup for the automap. Here is the example pk4: automap.pk4.txt

 

What steps need to be done?

 

1. Create the map:

 

This is obviously up to you, but if you like I can create a wiki article describing an easy approach to this.

 

2. Set up the location system:

 

You need to use this, as the single pieces of the map are corresponding to single locations. Give the locations unique, remarkable names, like "garden" or "guard_quarters" or whatever.

 

3. Set up the map gui:

 

The gui looks like this:

windowDef Desktop
{
	rect	  0,0,640,480
	nocursor 1

windowDef background_map
{
	rect	  64,48, 512, 394
	background "guis/automap/map_of"
	visible 1

}
....
}

This is the basic gui, showing the background image of the map (in this case the default image shipped with the startmap package). Where the dots are, you have to include the following

windowDef garden
	{
		rect 100,100,380,300
		background "guis/automap/garden"
		visible	"gui::gui_garden"
	}

for each location. It is important, that the name of the argument behind visible is of the following form:

"gui::gui_XYZ"

where XYZ is the name of the location entity. background is the image to show, and rect defines the rect where it is suppossed to be drawn. This depends on your images, though.

 

4. The entity definition and the code:

 

Both are shipped with the pk4, but you have to adjust the definition for your purpose. It looks like this:

entityDef atdm:automap
{
"inherit"			"atdm:map_base"

"editor_usage"		"game map of terrain for player" // THIS ONLY SHOWS IN ENTITY INSPECTOR

"inv_name"			"Map" // SHOWS IN PLAYER'S INVENTORY.
"inv_icon"			"guis/assets/game_maps/map_of_icon.tga"
"gui"				"guis/automap/automap.gui"
"scriptobject"	"inventory_automap"
}

There are two spawnargs that are important. inv_name is the name shown in the player inventory, so you may change it as you need it. gui is the name of the gui file used.

 

If you want to have several maps, make copies of this definition, give them all unique names (for example atdm:automap_groundfloor, atdm:automap_upperfloor etc.) and set the gui as needed.

 

 

That's it. Have fun testing it out. :)

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

This happens if something does not work as I've expected it ...

 

post-11230-0-23021000-1377287510_thumb.jpg

 

Always stay on the bright side of life ... :)

  • Like 2

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I'm trying to let a texture move. AFAIK this can be achieved via the command scroll, but somehow I can't get it to work. Any ideas?

 

Nevermind. I'm, an idiot.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

FADING WALLS

 

 

A little explanation on how the above can be accomplished. What you see there are basically two simple patches with two different but quite simple textures on them. Both are func_static and the first one responses to the stim fire, as it is caused by a fire arrow. This could also be something else, a different stim or whatever else you imagine. The effect on the response is to call a script function, which I will describe later on.

 

First about the materials. Both of them look quite similar:

textures/blendaway
{
   {
       maskcolor                
       map makealpha(textures/glass/glass1)
       alphatest parm5
   }
   diffusemap textures/darkmod/stone/brick/blocks_brown
}

This is the main part of the material definition for both textures. On the second one I added a further line to create the effect of glowing. What does these lines do?

 

The first block is for creating an alpha (transparency) map.

 

The command maskcolor says that the following lines (within the block) should not effect the color settings, so nothing is written to the red, green or blue channel. Only alpha is affected.

 

The second line adds the alpha. makealpha takes an image and convert its color values to an alpha value, by taking the intermediate value at each pixel and setting the color channels to one (that's why the first command is needed).

 

The third command alphatest has the effect that everything that has an alpha value lower then the given argument, in this case parm5 (which equals shaderParm5 in the editor), should not be rendered. This is basically used on decals, like leaves or dirt for example.

 

The last command outside the block adds our image on top.

 

So, as you can see what is visible and what not is controlled by two aspects. parm5 tells what parts should be rendered and which not and the choice of the image in makealpha tells us the distribution of those points.

 

As I've already said there is a script called which applies the effect. It looks as follows:

void fadeaway()
{
   float i;
   for (i=0;i<120;i++)
   {
       $patch.setShaderParm(5,i*0.01);
       $patch2.setShaderParm(5,(i-10)*0.01);
       sys.waitFrame();
   }
   $patch.remove();
   $patch2.remove();
}

patch is the name of the most frontward patch, patch2 the name of that behind it. Now, as you may see the code does nothing else then constantly increasing the shaderParm5 value (and therefore parm5 in the shader). As the texture on the second patch uses the same alpha, its fading is started a bit later (accomplished by the substraction) to accomplish the colored edge effect (the blue-greenish glow). After the fade-out is done, both patches get removed from game, so you can walk through them. If you want to let the wall appear later on, you could also just set them to nonsolid.

 

The glowing effect of the second texture is added by these lines in the material definition of the texture used on the second patch

   {
           blend add
           map models/darkmod/props/textures/holywater
           rgb 1
   }

The image applied is the same used for the diffusemap. As you can see I've used the texture that is used on the holy water potions. The rgb value controlls how strong the glowing effect is. 1 is already the maximum.

  • Like 4

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Thats an amazing effect... Seems like a fantastic mechanics to have in more magical oriented missions, or the classic fantasy maze. The fact you are always thoroughly documenting the procedures and donating all the assets to the community in undiluted, ready to use form, is indeed very valuable.

Link to comment
Share on other sites

Thank you for the kind words :)

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

  • 2 weeks later...

Thought I made my little status update here instead of spamming the "So what you are ..." thread.

 

I'm basically done with the basic brushwork on my speedbuild FM. I've also fixed the lighting problem I had to 99%, meaning there is still one area left where it is a bit buggy. I've already detailed a lot during the way, and will continue this tomorrow.

 

The starting section is still missing, but it will only consist out of two to three rooms or so, so I can do this in a few hours. Performance is great so far. If nothing worse appears, I'll need some betatesters at friday or so to check this one out, and can hopefully relase it at the end of this weekend.

 

I plan to release this as my unconventional Gameplay contest entry. I have two other missions in the making for that purpose, but they are too big to be finished til deadline. The smaller one should hopefully be ready til the end of October, the larger one I hope to finish til christmas. Don't know if I'll hit that personal deadlines though.

 

Taking all parts into consideration I mapped four to five months on the latter one, which should give you an impression of it's rough size. I hope it's worth the effort.

 

After these things are done I want to concentrate on small missions next year, as these provide a better workflow, and will hopefully engage new mappers two work on small missions themselves instead of getting lost in overambigious projects. And I definetely want to make an undead mission one day.

 

Some notes on the speedbuild WIP.

 

  • It'll be a daylight mission
  • It will be very difficult on difficulty levels beyond the lowest one
  • It's planned to be the start of a storyline/campaign
  • I'm going to implement some game mechanics not seen in TDM so far

 

 

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Update on my WIP:

 

Basic brushwork is done. Today I'll add models and details and will monsterclip everything. Tomorrow I'll setup the ai, special things as well as objectives and the map. So I guess I can start betatesting this on saturday. Everyone who wants to is happily invited.

 

Here are some screenies:

 

 

post-11230-0-05547500-1378992570_thumb.jpg

post-11230-0-71798900-1378992605_thumb.jpg

post-11230-0-80625200-1378992655_thumb.jpg

 

 

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

 

 

post-11230-0-32632100-1378992877_thumb.jpg

post-11230-0-90352800-1378992901_thumb.jpg

post-11230-0-33373800-1378992924_thumb.jpg

 

 

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Is this better?

 

 

post-11230-0-09703200-1379000047_thumb.jpg

 

 

 

EDIT: The shadows look much darker then they do ingame.

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

  • 4 months later...

Wow, I had forgotten about all of these cool scripts; glad Nbhor pointed the fog one out to me. Are these listed on the wiki somewhere?

 

OK. So here is the ambient fog scriptobject.

 

I know zero about fog...how does your method compare to using regular foglights in terms of performance?

Link to comment
Share on other sites

The script only uses one fog light. The radius is the same as used for the ambient light, but while testing I didn't experienced any performance impacts.

Are these listed on the wiki somewhere?

My wiki entries are listed in the link below (Obstipedia).

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Black and White

post-11230-0-23637300-1390673111_thumb.jpg

post-11230-0-15195800-1390673130_thumb.jpg

post-11230-0-89607200-1390673145_thumb.jpg

post-11230-0-31685400-1390673157_thumb.jpg

  • Like 4

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

The change is done via two speric patches of different diameter (24 and 128 doom units) bound to the players head. They are using the following material:

textures/darkmod/springheel/blur
{
    //deform sprite
   nonsolid
   translucent
   {
       vertexProgram        colorProcess.vfp
       vertexParm            0        1
       vertexParm            1        0.4                        // magnitude of the distortion
       fragmentProgram        colorProcess.vfp
       fragmentMap            0        _currentRender
   }


}

HUD, gui's (e.g. readables) and the player's model are not affected by this and need to be tweaked additionally.

The first vertex parm manipulates how strong the colors are averaged, the second one seems to affect brightness (not completely sure about this one).

 

It's quite nice to see what can be accompished with such shader programs. I'll definetely have to dig deeper into this materia. :)

post-11230-0-46915600-1390673759_thumb.jpg

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Wow, this is awesome! All kinds of cool uses come to mind, like dream-sequences, film noir missions, etc. Is there a way to do something half way between b&w and full colour? I've wanted a desaturation filter for ages.

  • Like 1
Link to comment
Share on other sites

VertexParm 0 controls how much the colors get desaturated. So you could set it to 0.5 for example.

 

textures/darkmod/springheel/blur
{
    //deform sprite
   nonsolid
   translucent
   {
       vertexProgram        colorProcess.vfp
       vertexParm            0        0.5
       vertexParm            1        0.4                        
       fragmentProgram        colorProcess.vfp
       fragmentMap            0        _currentRender
   }


}

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...