Jump to content
The Dark Mod Forums

Apples and Peaches: Obsttorte's Mapping and Scripting Thread


Obsttorte

Recommended Posts

I've just updated the wiki article: http://wiki.thedarkm..._player_actions

 

I had to made some last small changes, but now everything should work as expected.

Example map(updated): hitmanstyle.zip.txt

 

Have fun. :smile:

  • 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

@Grayman: I just took a look on the objectives letting things appear article in the wiki and the last sentence occoured a bit strange to me.

Hint: If all the success script fields are empty, the function is NOT called by any objective directly.

The problem is I can't remember what I've written there. But what I've meant was that when several objectives are causing the object appearance together the success script field should be empty, as a trigger is used to call the appropiate function. I will replace this line with something more close to what I've meant and more close to something distinguishable as engish. :smile:

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 is some of the job that Security Levels was going to do. That would set it up so that you only have to put a spawnarg on the AI and they'd automatically follow these rules. Actually I was getting caught up on AI registering the specific crimes, maybe your approach would work for it. The way I was doing it was setting a timer after the player lockpicks, frobs loot, etc, and if the AI has a visStim on the player you check that timer, and if it's below a level they "saw" the crime, and if not they didn't, and if they did you trigger the hostile code directly. Your way of just flipping the hostile / neutral team is pretty straightforward too though. And I was wondering how to register certain things, so this is useful to see that.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

This would be nice if it would get implemented sooner or later. The problem with the here mentioned setup is, that it is not very error prone. If the mapper forget to set some spawnargs on loot for example, or just mistype the name of the target, tha AI would not notice the player taken it. On a large map with lots of loot this is something, that a mapper may not be aware of that easely.

 

But the goal is quite useful imo, not only for hitman like missions. In city styled FM's for example, this behaviour could be used for the inhabitants (armed or not), so they would only get hostile if you entr there area (and get seen by that). This is quite more realistic and also good for performance, as if the player makes some noise on the streets, he dows only alert the guards out there, but not all the nearby inhabitants.

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

Yeah, relying on the mapper to set spawnargs on a lot of entities (and set and then keep them correctly in case something gets updated) is doomed to fail - too error prone, too complicated and so on.

 

Not that I want to discourage you, just saying that any system should recognize loot by the entity type/class, not because some spawnarg is set. It's a bit more complicated with the AI_USE things, because we have to distingush a camp fire from a torch even tho both are "flames". But these spawnargs are set by default on the nec. entities, so the mapper hasn't to do anything.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Instead of ropening a new thread for this I thought I just post it here.

 

I've build a tiny (really tiny) map over the last week and would need one or two betatesters. I may add that this mission is layed out for ghosting. So anyone who feels unpleasent with this may not like it at all.

 

If anyone is interrested you can post here.

 

Thanks a lot.

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

Why not? I have an evening or two to spare, and I tend to ghost missions. Sign me up!

Come the time of peril, did the ground gape, and did the dead rest unquiet 'gainst us. Our bands of iron and hammers of stone prevailed not, and some did doubt the Builder's plan. But the seals held strong, and the few did triumph, and the doubters were lain into the foundations of the new sanctum. -- Collected letters of the Smith-in-Exile, Civitas Approved

Link to comment
Share on other sites

  • 2 weeks later...

HI there,

 

is there a possibility to let unarmed AI trigger an alarm instead of running to a flee point? I tried it with targeting from the flee point but that didn't work.

 

Another question: Is it possible to change the "amount" setting on objectives during the game? I've tried several ways to achieve that: triggers and targets, script, but none of them worked. Actually I have found a different way to achieve my goal, but it is quite cumbersome.

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 set up an alarm that fires when an AI enters a trigger brush, and then put the flee point inside that trigger. Not ideal, though, since any AI walking into it would also set it off.

Link to comment
Share on other sites

Yeah, I see. Actually I thought more of the AI going to the flee point and than for example pushing a button to trigger the alarm. So the player still has the opportunity to KO him or take him out with an arrow.

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

Actually I thought more of the AI going to the flee point and than for example pushing a button to trigger the alarm.

 

 

I think that could be done as well. Have the trigger brush around the flee point, and have the trigger start a conversation that includes the AI walking over to the switch and pulling it. A conversation would only work for a particular AI, but that would nearly eliminate the problem of setting it off accidentally. Just put the flee point somewhere the AI doesn't usually go.

 

edit: Oh wait...if the AI is alert a conversation probably won't work....

Link to comment
Share on other sites

...but script commands probably will. I think script commands override anything the AI is currently doing.

 

Script gets called when an AI enters a trigger.

1) get AI name for the entity in the trigger area.

2) if that AI is alert, goto 3 else stop script

3) AI walk to path node next to alarm lever

4) AI use lever. (there has to be a script command for the use_righthand + trigger combo the AI used routinely to open doors. Is there?)

5) end script.

 

If you get this to work, it is surely wiki material.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Another question: Is it possible to change the "amount" setting on objectives during the game? I've tried several ways to achieve that: triggers and targets, script, but none of them worked. Actually I have found a different way to achieve my goal, but it is quite cumbersome.

 

Which way is that, and if there is a script event missing, please open a tracker, so I can add it. The objective text can now be changed, but I did not need to change anything else on an objective, so I left these out.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Actually I want to count the amount of knocked out and killed AI. My attempt was to have a hidden "ko one ai" objective in the mission. If this is fullfilled, it runs a script to change the spawnarg for the amount which increases it by one and than triggers a target_setobjectivestate to set it to not finished again. All this steps work, but if I than knock out a second AI, the objective gets not fulfilled again. So it seems that changing the spawnarg has no effect on the objective.

 

To bypass this I have to put several subobjectives into my objective: "KO one guard", "ko two guards", "ko three guards" and so on. The objective success logic is then to link them together via OR. This works as intented, but if I have for example 30 AI in my map, I would need 30 of this subobjectives, which is, as said, cumbersome.

 

Actually my first approach was to se the stim/response editor and add responses for KO and KILL on the ai, which triggers/calls than whatever needed. But that didn't work. :blush:

 

Looking into the TDM script reference it seems that there is no function to get the amount of knocked out or killed AI. At least there is a spawnarg "death_script" for the AI which I can make use of, but there seems to be nothing like that for KO's. Maybe I should take a look into the specific def files as it's maybe only just not listed.

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 should make a tracker entry for that, it sounds yet-another-missing interface from the scripting language to the SDK :)

 

It is probably not too hard to add all these things.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Allright, its #3297-3300 (the first three refer to this problem, the latter to the auto-map feature). :smile:

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've just updated the wiki article: http://wiki.thedarkm..._player_actions

 

I had to made some last small changes, but now everything should work as expected.

Example map(updated): hitmanstyle.zip.txt

 

Have fun. :smile:

 

This is brilliant, we were just talking about that the other day, this is a must for every mission with neutral NPCs! Must take a look at this... Awesome work.

Link to comment
Share on other sites

Thanks a lot.

 

Now, as promised a simple example map demonstrating an automap: http://www.mediafire...ov7ky45v16twp3a

 

A few notes:

  • I've used text to mark the areas you already was. This can be simply replaced with images.
  • This is a "mark visited places" map. The location you currently are is not marked extra. Anyways, this can be added with some simple changes if needed
  • This setup only allows one map. Having several maps is also simple addable.
  • As the scripting language don't know any containers like maps, the script gets quite long for maps with many rooms. But basically it is very simple to set up.
  • The main work goes in creating the map (as per drawing it) and arranging the single items. The rest takes just 10 minutes

I'm going to write a wiki article at the weekend that will describe everything in detail. I will also add the two missing functionalities there. Anyways, if you have questions, you can ask, of course. :smile:

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

Revision: I have written that

This setup only allows one map.

Actually that is not true. The only thing one have to keep in mind is that every map needs its own show/hide function. Else it should work.

 

A note on marking automaps, thus meaning maps that note where you have already been and highlight the area where you currently are. This only need a small change in the code. Instead of running the mark function via "call_on_entry" it is executed via "call_on_exit". "call_on_entry" therefore executes a function that is similar but sets the specific float to "2". This leads to the variables having the values 0/1/2. Some of them are "0" (you haven't been there), some are "1" (you have been there) and one is "2" (you are here). The function that shows/hides the map therefore needs a change to show a different gui when the value is "2". Obviously you would need a second, highlighted version of that specific map part.

 

It seems to me (guessing from what has been written in the forum) that this kind of functionality is not very liked by most people. Actually I think it is a mapping decision. If you want the player to orientate by himself you may not want that. But if the map layout is quite confusing, like for example a cave/dungeon or so, this may prove useful.

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

Thanks a lot.

 

Now, as promised a simple example map demonstrating an automap: http://www.mediafire...ov7ky45v16twp3a

 

A few notes:

  • I've used text to mark the areas you already was. This can be simply replaced with images.
  • This is a "mark visited places" map. The location you currently are is not marked extra. Anyways, this can be added with some simple changes if needed
  • This setup only allows one map. Having several maps is also simple addable.
  • As the scripting language don't know any containers like maps, the script gets quite long for maps with many rooms. But basically it is very simple to set up.
  • The main work goes in creating the map (as per drawing it) and arranging the single items. The rest takes just 10 minutes

I'm going to write a wiki article at the weekend that will describe everything in detail. I will also add the two missing functionalities there. Anyways, if you have questions, you can ask, of course. :smile:

 

Man, you really beat me to every feature I want to add to Swift Mazes.... but heh, at least that way I have to figure out only half of the stuff :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

It's on: http://wiki.thedarkmod.com/index.php?title=Creating_Automaps

 

Any language correction would be nice (you know, my english :blush: )

 

Hope you like it. Advices of any kind (for example if something is unclear) are always welcome.

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

    • 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
       
      · 2 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
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...