Jump to content


Photo

Apples and Peaches: Obsttorte's Mapping and Scripting Thread

mapping scripting obsttorte

416 replies to this topic

#51 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 11 January 2013 - 12:11 PM

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): Attached File  hitmanstyle.zip.txt   3.7KB   198 downloads

Have fun. :smile:
  • Springheel and RPGista like this
FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#52 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 11 January 2013 - 06:59 PM

@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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#53 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 11 January 2013 - 08:47 PM

That line confused me, and I wasn't quite sure how to rewrite it. If I edited it, the change was small, and I hoped that I pushed it more toward whatever its true meaning was, w/o knowing what that meaning was. :wacko:

#54 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5086 posts

Posted 11 January 2013 - 08:49 PM

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.
Posted Image

#55 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 12 January 2013 - 03:40 AM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#56 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 12 January 2013 - 05:54 AM

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

#57 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 13 January 2013 - 07:34 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#58 Melan

Melan

    Contest Winner, Wordsmith

  • Campaign Dev
  • PipPipPipPip
  • 4280 posts

Posted 14 January 2013 - 08:18 AM

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

#59 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 14 January 2013 - 09:31 AM

I'd like to help.

#60 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 22 January 2013 - 04:33 PM

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, 22 January 2013 - 04:37 PM.

FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#61 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 35803 posts

Posted 22 January 2013 - 05:34 PM

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.
Posted Image

#62 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 22 January 2013 - 05:41 PM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#63 SeriousToni

SeriousToni

    Beginner Contest 2012 Winner

  • Member
  • PipPipPipPip
  • 2187 posts

Posted 22 January 2013 - 07:23 PM

I missed that feature very hard. Since it was so cool in Thief 1 when the ai switches on the alarm in Cragscleft :o
"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

#64 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 35803 posts

Posted 22 January 2013 - 07:45 PM

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....
Posted Image

#65 Sotha

Sotha

    Vertical Contest Winner

  • Active Developer
  • PipPipPipPipPip
  • 5489 posts

Posted 23 January 2013 - 12:53 AM

...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.

#66 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 23 January 2013 - 01:52 AM

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

#67 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 23 January 2013 - 03:09 AM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#68 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 24 January 2013 - 02:28 AM

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

#69 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 24 January 2013 - 04:48 AM

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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#70 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1332 posts

Posted 24 January 2013 - 06:47 AM

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): Attached File  hitmanstyle.zip.txt   3.7KB   198 downloads

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.

#71 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 24 January 2013 - 02:53 PM

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, 24 January 2013 - 02:54 PM.

FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#72 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 35803 posts

Posted 24 January 2013 - 03:59 PM

Wow, cool! :)
Posted Image

#73 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 25 January 2013 - 03:42 AM

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, 25 January 2013 - 03:42 AM.

FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#74 Tels

Tels

    Mod hero

  • Member
  • PipPipPipPipPip
  • 15024 posts

Posted 25 January 2013 - 04:03 AM

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

#75 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 25 January 2013 - 06:43 AM

It's on: http://wiki.thedarkm...eating_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
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.



Reply to this topic



  



Also tagged with one or more of these keywords: mapping, scripting, obsttorte

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users