Jump to content
The Dark Mod Forums

Apples and Peaches: Obsttorte's Mapping and Scripting Thread


Obsttorte

Recommended Posts

I've just saw that the svn is availale on the darkmod page. :smile:

 

EDIT: Found the instructions on the wiki. I barely remember that I've tried this. Will see if I can build it under linux as I haven't VS 2010

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

As you can see in the beginning it checks if the point was already reached. I guess this is the best place to insert the code

 

No.

 

These states and tasks are responsible for fleeing:

 

FleeState

FleeDoneState

FleeTask

 

You'll want to familiarize yourself with these and find what they do when they complete.

 

If the Flee event is going go be extended to handle seeking out an alarm button, it needs to be handled at the start of FleeDoneState, rather than sticking it inside MoveToPosition(), which is called every frame for every AI as pathfinding tells them where to go. FleeDoneState can then let them push the button and then continue with the normal business of FleeDoneState, which is to look around for friends that might be able to help.

 

======================

 

Edit: After giving this a few moments of thought, it might be best to NOT make pushing an alarm button part of the Fleeing state.

 

If a mapper ever wants his AI to "raise the alarm" because they saw something bad, he'll want those AI to make that happen regardless of whether they're fleeing or not.

 

We have AI states for relighting lights and examining ropes, each of which causes an AI to go to a specific place to do a specific thing. Pushing an alarm button sounds like the same set of actions, so it should be handled the same way.

 

If pushing an alarm button is going to come out of the scripts, and be added to the DLL code as core behavior, it ought to be done with code that allows for finding the nearest alarm button, running to it, handling elevators and doors along the way, hitting the button, then running back to where the offense was observed. Create OperateAlarmState, and let him do the work.

 

With that in place, you can now go to FleeDoneState and have your AI enter the new OperateAlarmState. If the mapper placed a flee point right next to an alarm button, then OperateAlarmState takes care of all the details. OperateAlarmState could choose not to send the AI back to where the offense was observed, using the same conditions that got the AI fleeing in the first place: unarmed, ill health, or civilian.

 

OperateAlarmState also should handle the steps necessary for turning off the alarm later if the mapper wants to do so. There's nothing to say that the AI that turns the alarm off needs to be the one that turned it on.

 

My two cents.

Link to comment
Share on other sites

That makes sense. I barely remember seeing the states somewhere in the code, will need to look at it. Found the files.

 

Another thing. I've tried to download the svn using RapidSVN. It asks me for an authorization. Am I doing something wrong or is this normal?

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

That makes sense.

 

Better read my edit. My suggestion changed.

 

Another thing. I've tried to download the svn using RapidSVN. It asks me for an authorization. Am I doing something wrong or is this normal?

 

Yes, you need permission to deal with the SVN repository. I don't know how to grant it, though. greebo used to do that, and hopefully someone reading this thread knows what you need to do.

Link to comment
Share on other sites

Well, that gives me some time to think about the problem. :smile:

 

Just for clearence:

  • operateAlarmState doesn't exist, it would be a new state to handle the alarm thingy
  • finding a alarm button (if any) should be independent from where the fleepoints are
  • the ai needs to be aware of whether the alarm is on or not, so he can turn it off
  • there needs to be some condition that decides whether or not the alarm can be turned off
  • these conditions refer both to circumstances (time passed etc.) and maybe the ai (what kind of ai's should be allowed to turn off the alarm? only guards (weapon carriers), people of high rank (->spawnarg "rank") ...
  • The mapper should be able to control this behaviour (script functions to let an ai run an alarm or to disable it?)
  • did I overseen something?

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

Didn't I set you up with an account for SVN when I made you a team-member? I can't remember now.

Link to comment
Share on other sites

The code SVn repository is read-only for guests, which means you can download the code freely, but if you want to commit, you need an account. (I can't set you up, btw, haven't got the permissions)

"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

@Springheel: You've told me, but you never gave me the login informations. ;)

@Tels: It's mainly for testing purposes I guess. What goes into the code and what not may be decided by people who've spent more time with it.

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

  • operateAlarmState doesn't exist, it would be a new state to handle the alarm thingy
  • finding a alarm button (if any) should be independent from where the fleepoints are
  • the ai needs to be aware of whether the alarm is on or not, so he can turn it off
  • there needs to be some condition that decides whether or not the alarm can be turned off
  • these conditions refer both to circumstances (time passed etc.) and maybe the ai (what kind of ai's should be allowed to turn off the alarm? only guards (weapon carriers), people of high rank (->spawnarg "rank") ...
  • The mapper should be able to control this behaviour (script functions to let an ai run an alarm or to disable it?)
  • did I overseen something?

 

OperateAlarmState doesn't exist. I suggest copying SwitchOnLightState.{cpp,h} as OperateAlarmState.{cpp,h} and add them to the project.

 

SwitchOnLightState already has states for finding and pushing buttons. Start at the Init() method and follow the path for relighting electric lights and remove anything having to do with relighting flames. At spawn time, each button registers itself with any lights it controls, and when it's time to pick a button to push, the light in question hands them over to the AI to decide which one's closest. You could do something similar for alarm buttons.

 

Remove any code that you don't need. Change the state names to what makes sense. Etc. etc.

 

If you can figure out how to set up the files, get them into the project, and start going through the code on your own, great. If you need me to get things set up for you so you can start making the changes, I'll be happy to do that.

 

As for the other bullets, they look reasonable. They all have to do with decisions to be made before entering the new state.

Link to comment
Share on other sites

Thanks. :smile:

 

As for the other bullets, they look reasonable. They all have to do with decisions to be made before entering the new state.

Yep. So I go creating the new state and we care about that later on. Springheel is gonna giving me the read access to the svn and then I'll start. I'll pm you if I get stuck (what I don't hope).

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

BLOODY

 

I've just saw that I've had an error in my trigger_look script I've uploaded a while ago. It was used for triggering event when looking at something.

 

However. Here's the corrected version.

 

trigger_look.script.txt

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

Last weekend I've created a throwable torch. It's basically a extinguished torch that can be picked up by the player and goes into his inventory. If he uses it it get's thrown (now burning). All in all it works similar to the T2 flares. The main difference is, that it is able to set things in fire (like explosive barrels :smile:).

 

I've also just created a scriptobject to be used on ai. It has something to do with torches. You can see the result in my Old Habits revamp. :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

It's a speed rebuild, so I hope it will be ready this weekend or on beginning of the next week, depending on how long beta-testing takes.

 

The script object is a file that just needs to be copied into the scripts folder and be included via the tdm_custom_scripts.script file in this folder. Then you just have to tell the ai to use it (spawnarg "scriptobject") and add a custom stim to the specific torches. It's pretty easy.

 

Anyways, I need to polish the script a bit.

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 thought I continue posting here instead of spamming up the "So, what you are ... " thread.

 

Geometry is done so far, only some details here and there, not much. A couple of visportals are missing. I start adding models and lightsources, now. I don't have a single door in the mission by now as I want to look if everything performs good when all possible VP's are open. Currently everything runs smooth around 60+ FPS :smile:

 

Here in germany we have off on wednesday, so I hope I can finish the map and start the beta this day. Btw.: Any volunteers?

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 have had a couple of ideas for my Old Habits rebuild, which I really wanna add, so it will take a few more days to finish the mission.

 

As I've already mentioned I created two new ai scriptobject, which differ there behaviour a bit. One of them is crucial for the tension in my mission, so I really don't want to spoiler it now, but the other one I think I can present, as it may appear unfair anyways if I do not inform the players about that behaviour.

 

So, what is all the fuzz about!?

 

Imagine you are a guard. You do your patroling stuff, bored as always, and suddenly you hear a noise in the dark corners of the room you are currently in. You are sure that someone is there, but it is really dark and you can't see anything in said corner. Good luck, there is a torch nearby. So, what are you going to do?

  1. You stumble into the darkness, hoping that you don't get blackjacked from beyond or end up with a broadhead in your face?
  2. You take the torch so you can enlight the dark corner of the room to reveal whoever is hiding there?

Your choice, my script :smile:

 

I will polish it up and upload and explain its usage tomorrow. Cheriou (or however it is written)

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 guess he don't know ^_^ . The above story was just a rough explanation of what the script is doing. :rolleyes:

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

OK. So here is the ambient fog scriptobject.

 

IMPORTANT NOTE: I've uploaded a corrected version below

 

You have to use the zone system to make it work.

 

Create a copy of your info_locations_settings entity or simple create a new one, and set the following spawnargs on it.

  • "scriptobject" "fog_system"
  • "fog_fade_time": the time in seconds it should take to blend into the new fog
  • "update_period": (optional), how often the system checks for location changes

On every info_location entity place the following spawnargs:

  • "fog_color": a vector containing the RGB values the fog should use, each of them ranging from 0-1
  • "fog_density": the density of the fog, the higher the value, the more dense the fog. A value of 0.1 means it is completely opaque in 1000 doom units distance, a value of 0.01 means in 10000 doom units and so one

You don't have to create a fog, this is done by the script. If you decide later on to remove the fog from your mission, you just have to erase the info_location_settings entity which is using this scriptobject

  • Like 3

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

 

It appears to solve the problem of crossing from a fogged area to a non-fogged area and back again, w/o encountering the nasty fog borders.

 

Being able to change fog color based on location is also very nice. We can have cold fog outside and warm fog inside.

 

If one doesn't want the fog light to have ambient_world's volume, one could create a dummy light with the appropriate volume and use that in place of ambient_world.

 

Good work.

Link to comment
Share on other sites

Is this math correct?

 


ic_x = nc_x*t/m_fadeTime+oc_x*(1+t/m_fadeTime);
ic_y = nc_y*t/m_fadeTime+oc_y*(1+t/m_fadeTime);
ic_z = nc_z*t/m_fadeTime+oc_z*(1+t/m_fadeTime);

 

When t = 0, we get oc, which is good.

 

When t = m_fadeTime, we get nc + 2*oc, which is bad.

 

I think you want minuses instead of pluses on the oc expressions.

 

Also, since there's no guarantee that m_fadeTime is a multiple of m_updatePeriod, it's possible that you'll never see t = m_fadeTime, so when it falls out of that loop, it should probably do a final setting of setLightParms() with nc and nd so the fog arrives exactly at the desired settings.

 

And one last thing and I'll go away.

 

Since "update_period" is optional, if the mapper doesn't set it, what does that do to your loop?

Link to comment
Share on other sites

1.) Yep, it should be minus, little typo.

ic_x = nc_x*t/m_fadeTime+oc_x*(1-t/m_fadeTime);
ic_y = nc_y*t/m_fadeTime+oc_y*(1-t/m_fadeTime);
ic_z = nc_z*t/m_fadeTime+oc_z*(1-t/m_fadeTime);

2.) I'm not sure this is so important, but I can do that.

3.) update_period has a default value on the info_location_settings entity (0.1 or so).

 

EDIT: Here's the corrected version

 

 

tdm_fog.script.txt

  • 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

2.) Than I didn't said a word :o

(I've fixed that, too).

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

    • 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
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...