Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Yep, construct everything out of patches only. Then do the following. Make sure that the above patch is 5 rows width, the lower plain one should be three rows wide. This way you can have the patches match each other.

 

 

Will post example

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 ya go:

post-11230-0-69139400-1367248269_thumb.png

 

curved.pfb.txt

 

Don't forget to delete the txt ending on the latter. I hope it helps. :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 appreciate the responses and the assistance with the construction. Just for the record though, I did build one of them entirely of patches, as I know you can't bend brushes ;)

 

The problem that I was having, and it looks like may still be happening, is that the panel patch is being stretched. I'm not on my home PC, and I'll check it out more when I do get home.

 

I see what you mean about breaking the patches up, and it may yet provide the solution I'm looking for in this case. I had attempted doing that in the example I had posted before, about adding windows to a curved patch. It became such a headache that I threw the entire thing away.

Link to comment
Share on other sites

The problem that I was having, and it looks like may still be happening, is that the panel patch is being stretched

If you want the curved panel to have (almost) exactly the same width as the plane panel, you have to adjust the radius according to the size of it.

 

Example: Let's guess the plane parts are 64 doom units width. You then want the curved part to have 64 doom units circumradius, thus meaning the length of the longest, curved side.

 

The length of the curved size with a 90° radius is PI*0.5*radius (PI*0.5 == 90°). So the radius must be 64*2/PI what equals roughly (taking PI with 3.2) 40 doom units.

 

See picture below

 

post-11230-0-73491800-1367257874_thumb.png

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 there a way to read out spawnargs on worldspawn?

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 there a way to read out spawnargs on worldspawn?

 

What do you mean by 'read out'?

 

Do you mean, "Is there a way a script can obtain spawnargs on the world entity?"

 

If so, then you can probably use

 

$world.getKey() (as well as the other get* routines)

Link to comment
Share on other sites

That's what I've meant, thanks.

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 running into a problem which I'm sure has a simple solution. I'm trying to get a helmet on a revenant AI: I'm using the saxon helmet prop and using BindToJoint with the "head' joint. The problem is that the movement of the revenant's head is somewhat independent of the head joint and so in some of the idle animations his skull clips through the helmet quite noticeably. Is there another joint I should be using to avoid this?

But you should walk having internal dignity. Be a wonderful person who can dance pleasantly to the rhythm of the universe.

-Sun Myung Moon

 

My work blog: gfleisher.blogspot.com

Link to comment
Share on other sites

I'm not sure you can do it with bind. Bind works on the main entity, which is the body. The body has a head joint, but the entire AI head is actually a separate def_attached entity that moves on it's own. You really want to bind it to THAT, but I'm not sure you can in DR since the head doesn't show up.

 

What might be easiest is making a new head entitydef. Take the revenant head entity, and find the saxon head entity that has the def_attached helmet with the attachment values, and copy and paste them together to make a new entity. Then attach that head to your revenant.

 

Here, try this:

 

entity [name]

{

"inherit" "atdm:ai_head_revenant"

 

"def_attach1" "prop_saxon_helmet"

"pos_attach1" "velvetcap_1"

 

"fov" "110" // horizontal FOV blocked by helm

}

 

 

 

The head might clip through the helmet though.

Link to comment
Share on other sites

How did you attach the head? Once you create the head entity, save it in darkmod/def/[file].def.

 

Then add the following to your AI:

 

"def_head" "[name]"

Link to comment
Share on other sites

Thanks Springheel,

 

When I try it out, I get the following error:

 

Game Error: Joint "Head" Not Found for Attachment Position "VelvetCap_1" on Entity.

Isn't the attachment position name "head" (case-sensitive)?

 

EDIT: What you could also try is to set the following spawnargs on your revenant:

"set def_attach1 on head" "prop_saxon_helmet"

"set pos_attach1 on head" "velvetcap_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 there a way to ask AI what it's target is?

I'd like to clear an AIs target so that I can give him a new one. There is no way to clear AI targets and the removeTarget() needs to know which target it will remove from the AI. getTarget is obvious, but it needs a number as argument. I tried it but I get a crash.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Is there a way to ask AI what it's target is?

I'd like to clear an AIs target so that I can give him a new one. There is no way to clear AI targets and the removeTarget() needs to know which target it will remove from the AI. getTarget is obvious, but it needs a number as argument. I tried it but I get a crash.

 

You can do it from a script.

 

entity targetedEntity = $AIName.getTarget(0);

 

This will get you the first entry in the list of targets. I don't think it matters what 'target{N}' you used in the spawnargs.

 

Edit: Ooops. Just saw that you tried this. Did you try it with '0' as the argument?

Link to comment
Share on other sites

You can do it from a script.

 

entity targetedEntity = $AIName.getTarget(0);

 

This will get you the first entry in the list of targets. I don't think it matters what 'target{N}' you used in the spawnargs.

 

Edit: Ooops. Just saw that you tried this. Did you try it with '0' as the argument?

 

Yes.

 

I have an AI called "aaii". He has no targets. He stands still.

 

I pull a lever that gives him target and he starts walking. Script:

void givetargets_near()
{
 sys.println("giving target near");
 $aaii.addTarget($path1);
}

 

I pull another lever that does the following:

void removetargets()
{
 sys.println("removing target");
 entity target = $aaii.getTarget(0);
 $aaii.removeTarget(target);
 $aaii.stopMove();
 }

 

The AI flinches and continues walking. Console says both commands were executed, judging from the sys.println:s. There was no error messages. If I now pull the remove target lever once more, I get an error that says "entity not found for removeTarget. Terminating thread."

 

So it looks like it is just not possible to clear AI targets so that they could receive new paths? It seems the script DID clear the AI targets, but still he walks between the two paths_corners.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

The target is only the spawnarg, and it seems that removing it has no effect at the ai movement.

 

You may try the following functions:

  • endState()
  • setMoveType(0) or setMoveType(1)

If you want the ai to move to a specific position under certain circumstances, you may also consider using moveToPos(vector pos) or MoveToEntity(entity e).

 

Good Luck!

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 seems the script DID clear the AI targets, but still he walks between the two paths_corners.

 

When the guard started his walk, he'd already processed the target; its origin was turned into a spot for him to walk to.

 

Taking away his 'target' won't change that. He's still going to walk to the spot.

 

Perhaps you can describe the behavior you're trying to create.

Link to comment
Share on other sites

I wanted to make changing guard behavior:

Lord is in his room. Guard stands outside his room, by the door.

Lord RIT takes him out from the room to walk the premises, the Guard leaves his post at the door and walks with the Lord.

 

It would have been simple with the new targetings: guard stands at the door, lord comes out. Clear AI targets, stop whatever you are doing and start following the lord.

 

I know grayman had something like that in In the North and even examined the script, but it looked too difficult for my skills. If there isn't a simple "stop your current patrol and start a new" behavior, I'll just discard.the idea and put the AI on ordinary RIT patrolinstead, no problems. :)

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I would suggest using a combination of moveToEntity(entity e) and 2 trigger_entityname's responding to the lord. I'll go creating an example map and upload it here.

 

Here it is:sotha.zip.txt

 

This is just a rough hack. I can do that better :smile:

 

But at least it shows how it would work in principal.

 

I will upload a better version this evening.

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!

 

It is simple enough for me to understand, but it is too simple to allow basic interesting things, like

Guard sits in the room, by the fire. Boss walks in. Guard gets up and walks out of the room and stands guarding the door. When Boss leaves again, guard goes back in to sit by the fire. Maybe he occasionally gets up and looks at the bookcase when he waits for the Boss to return. AI with no targeted paths will not recover from a situation where the player was seen or the Boss KOd.

 

My problem with controlling AIs manually with scripts is that you need to write complex, error prone stuff to get relatively simple behavior one is used to just by placing path entities. Too many loose ends. :wacko: Maybe this ain't a good idea.

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Yeah, I see what you mean. I take another look at it, maybe I can find a workaround that makes it possible to let the guard use a path network when not "needed" by his chief. Gimme some time, I'll post this evening :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

Remember that you can use location entities to help out here.

 

A script can ask for an AI's location entity, and then behave differently depending on the result.

 

If the Boss is in "the room", the script can tell the guard to go do RIT.

 

If the Boss isn't in "the room", the script can take the guard off RIT and tell him to go sit in the room.

 

In the North used location entities to keep the Lady and her guard together. The Lady was set up to RIT her way between the library and the dining room. A script kept track of where she was, and if she was in the dining room, it told the guard to go to the dining room. If the lady left the dining room, the only place she could go was the library, so the script told the guard to go to the library. Ditto for the reverse of the Lady leaving the library and walking back to the dining room.

 

So location entities can tell you where actors are, and that might help your script.

Link to comment
Share on other sites

If the Boss is in "the room", the script can tell the guard to go do RIT.

Is there a way to let ai go on a patrol (defined by paths) and later "take it away" from doing so, like quitting the patroulling?

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