Jump to content
The Dark Mod Forums

Sir Taffsalot's mapping thread


Sir Taffsalot

Recommended Posts

if you are not familiar with scripting I can make you an example map or you just ask if something is unclear

I hope that helps

 

I dont know anything about scripting so I'd find a map extremely helpful if you dont mind. Thank you obsttorte!

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

in your main routine you use the following code ...

 

I suggest not tying up main() with an endless loop. If you ever want main() to do other things, you have a problem.

 

Instead, put the loop in its own routine:

 

void CheckWeapon()
{
do
{
	if ($player1.getCurrentWeapon() == 'atdm:weapon_unarmed')
	{
		//player carries no weapon
		unsetWeapon();
	}
	else
	{
		//player carries weapon
		setWeapon();
	}

	sys.wait(1) //wait a sec

} while(true); //end-do
}

void main()
{
// run the constant weapon check in its own thread,
// so that main() isn't tied up

thread CheckWeapon();

// at this point, CheckWeapon() is running in its own thread,
// allowing main() to continue on with other work
}

  • Like 1
Link to comment
Share on other sites

@grayman: thanks for the hint ^_^:blush:

 

@taffsalot: here ya go

 

https://www.mediafir...jbgcudg7nh6g8ek

 

the map basically does the following:

 

-if the AI sees you steeling the loot or drawing your weapon it goes to alert state

-this will be noticed by the first objective, who calls a script (which in this case just writes something to the console)

 

for setting this up you need (in addition to the script) the following things:

 

- AI: set spawnarg "team" "5" (this is neutral to the player)

- two entities atdm:target_setrelations (can be found under targets)

- one trigger_relay (under triggers)

 

you should give them short and easy to remember names (I didn't do this here as it's only an example)

EVERY piece of loot must target one of the target_setrel. - entities (called "the first one" furthermore) and the trigger_relay

the trigger_relay targets the SECOND target_setrel.

 

on the first target set: "rel 5,0" "-1"

on the second target set: "rel 5,0" "0" (or "1", doesn't really matter, 0 is neutral, 1 is friendly)

on the trigger_relay set: "delay" "1"

 

thats it

 

OK, what happens:

the first target sets the team 5 hostile to team 0 (the player)

the second target sets it back to friendly

the trigger_relay delays the second target by one second, so if you are seen by the AI within one second after steeling something, they will see you as an enemy

 

the script for the weapons works similar

 

the objective is fulfilled when any AI goes to alert state 5 (sees you)

the script that is then called deletes the second target so the hostility cannot be unset anymore

(I didn't do that but it may be better to trigger the first target in this method, just to be sure)

 

the second objective by the way is only a place holder, so you can examine the effect without the mission ending

 

in your mission you may make this objective invisible

 

it's a little bit different to what I've said earlier, but I just realized there is no "AI sees player" objective

I hope you are satisfied with the results

Edited by Obsttorte
  • 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 wiki-entry material?

 

I guess not, at least I didn't looked there. I found the command string getCurrentWeapon() on the doom3 modwiki (best place to look up for scripting btw). I could make a wiki entry if I would know how (to sign up).

 

Your a star Obsttorte!

 

Thank you very much. Your welcome.

 

If you have questions, you can, of course, ask. There are some constants in the code that may be changed to alter the specific behaviour a bit.

 

Btw.: something that came in my mind is a constant that handles how long you are suspicious after steeling something. In the test map this is as said above one second. But as it is a spawnarg and those can be changed via scripting there could be several values for this depending on the difficulty level. For example 1/1.5/2 seconds on easy/medium/high difficulty level. This would mean that it would be more difficult to steal something unseen on higher difficulty levels. Don't know if this sounds interesting to you. 1 second may also seem a little bit long to you, but decreasing this value too much can cause the effect not to work. Well, try it out.

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

Btw.: something that came in my mind is a constant that handles how long you are suspicious after steeling something. In the test map this is as said above one second. But as it is a spawnarg and those can be changed via scripting there could be several values for this depending on the difficulty level. For example 1/1.5/2 seconds on easy/medium/high difficulty level. This would mean that it would be more difficult to steal something unseen on higher difficulty levels. Don't know if this sounds interesting to you. 1 second may also seem a little bit long to you, but decreasing this value too much can cause the effect not to work. Well, try it out.

 

Bloody awesome idea! I'll definately alter the suspicion lengths between difficulty levels and see how it works out.

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

cool, add the following spawnargs on the trigger_relay (without quotation marks)

 

"diff_1_change_0" "delay"

"diff_1_arg_0" "1.5"

"diff_2_change_0" "delay"

"diff_2_arg_0" "2.0"

 

another thing: in the current configuration the code will not differentiate between the player is lit or in complete darkness

this could be bypassed with a short script change but would only be necessary if in the non-hostile areas were spots where it is completely dark

don't know if you need this though, let me know

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

another thing: in the current configuration the code will not differentiate between the player is lit or in complete darkness

this could be bypassed with a short script change but would only be necessary if in the non-hostile areas were spots where it is completely dark

don't know if you need this though, let me know

 

Wow that would be very interesting. Although I really dont know if I would need that or not. Apart from some sketches I haven't done anything on this map yet so its hard to say. I think it mite be nice to have a contrast between the way you aquire loot in the 2 zones. In the hostile zones (1st floor and basement) You can aquire loot by sneaking around. In the non-hostile zone (ground floor) You dont have to sneak around but can aquire loot when the AI is not looking. I might get back to you later if I need it but right now I dont think I do.

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

  • 2 weeks later...

servus,

 

does it work out correctly? I didn't tested it for too long and only in the test map so I would like to know how it behaves in a more FM typical scenario.

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

Hello Obsttorte,

 

I havent started on the map yet. I've spent the last few weeks going through Blender tutorials. Nosslak has kindly donated his ball masks to me and I'm trying to see if I can finish them off. Once their ready then I'll start work on the FM.

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

  • 4 weeks later...

The readable itself you must place where you want it to appear in the game.

In the objectives menue there is a field "completion target". In this field put in the name of a trigger_count entity you've created. Do this for all objectives you want to be counted. On the trigger_count entity you have to set the spawnarg "count" IIRC to the number of objectives you want to be completed before the specific object should appear. This entity will then trigger its targets once it has been triggered by enough objectives. Let the trigger_count entity trigger a target_call_script_function. Set the spawnarg "call" "functionname" and insert the following script to your mymapname.script

void functionname() {
   $readablename.show();
}

where readablename is the name of your readable (surprise, surprise).

In the main function of your script file place the line

$readablename.hide();

 

Remember: Everything in the main routine will be executed upon map start. In this case the book or whatever will be hidden (this means not just that it is invisible, it is not in game). The above described function let the object appear in game.

 

Note: I did this with the

 

 

lever on the machine in the basement

 

 

on my FM. If you're unsure you can also look there.

  • 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

  • 3 weeks later...

I'm trying to add a custom texture to my map. I changed the "tdm_textures_paint_paper01" folder from a PK4 to a ZIP. Unzipped it. Added the texture to the following folder "tdm_textures_paint_paper01 / textures / darkmod / paint_paper". I zipped the folder up then changed it to a PK4 and put it back in to the Darkmod folder. Now none of the paint paper_textures the texures no longer display in DRs media window. What have I done wrong?

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

Also why are AIs becoming alert when they see me? I've given them the spawnrag "team 0". That means there on the same team as the player right? I'm using the prefabs for the AIs playing cards and drinking beer if that means anything.

 

Edit: More specifically they dont attack me but they become alert to any sound I make.

Edited by Sir Taffsalot

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

Weapon sounds (arrows hitting things or swinging a blackjack) cause alerts regardless of who makes them. Throwing objects shouldn't alert people on the same team though.

Link to comment
Share on other sites

I'm not doing any of the above. As soon as I load the map the AIs go on alert. The player starts in a room above a tavern. They have to walk through the tavern to get to the streets. I want the AI in the tavern to be neutral to the player. Is there a way to have the prefabs of AI playing cards and drinking beer in the tavern but not react to the player?

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

AI attacking: As far as I remember it is not possible to put any AI on team 0. Put them in another team (1 for example) then target a target_setrelations entity from worldspawn. On the entity set "rel X,0" "0" where X is the team you've put them in.

Textures: I think you don't have to zip them to use them. Use the same approach as for readables, models and so one. Just create the textures folder and what else you need in your darkmod folder and put the files in there. You only have to remember not to forget to pack them up in your fm pk4 when shipping the mission. ;)

 

Hope that helps.

Edited by Obsttorte

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

You can put them on team 0; I do it all the time when testing. Could they be seeing an AI that is not on team 0? That will alert them.

Link to comment
Share on other sites

Well, I thought I've read that somewhere. Anyways, would'nt it be easier to use notarget for testing?

I'm using the prefabs for the AIs playing cards and drinking beer if that means anything.

I'm using that, too in the same situation (they're on same team) and it works correct. So I would go for Springheel's advice and recheck if you've set the team spawnarg correct on all AI.

Edit: More specifically they dont attack me but they become alert to any sound I make.

This sounds a bit weird as it never occoured to me. Can you please post an example map if you don't get that fixed by yourself?

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

http://www.freeuploadsite.com/do.php?id=2697

 

I'm pretty certain that I've put the player on the same team as the AI before and they ignored me. The bar maid was in the map from the start and on team 0. No problem. As soon as I put the AI prefabs in then I started having issues.

 

Also can someone upload the tdm_texturs_paint_paper01.pk4 from their darkmod folder? It appears that I've buggered mine up and cant get it to work anymore. Thanks!

"I believe that what doesn't kill you simply makes you... stranger"

 

The Joker

Link to comment
Share on other sites

Also can someone upload the tdm_texturs_paint_paper01.pk4 from their darkmod folder?

May be easier to just delete it and run the updater again!?

 

EDIT: You cannot change the team of the player. I'll upload a corrected version.

Edited by Obsttorte

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

Here's the fixed version:015.zip.txt

 

Note: On a previous post I've said to add the spawnarg "rel 1,0" "0". I had a space in there - that is wrong. This spawnarg does not work if you use for example "rel 1, 0".

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

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 0 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...