Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

What is the code syntax for adding damage onto an AI via a script?

/**
 * Deals damage to this entity (gets translated into the idEntity::Damage() method within the SDK).
 * 
 * @inflictor: the entity causing the damage (maybe a projectile)
 * @attacker: the "parent" entity of the inflictor, the one that is responsible for the inflictor (can be the same)
 * @dir: the direction the attack is coming from.
 * @damageDefName: the name of the damage entityDef to know what damage is being dealt to <self> (e.g. "damage_lava")
 * @damageScale: the scale of the damage (pass 1.0 as default, this should be ok).
 */
scriptEvent void damage(entity inflictor, entity attacker, vector dir, string damageDefName, float damageScale);
Link to comment
Share on other sites

The goal is to poison a piece of food that the AI Arne eats. After that, he shall go about and take damage at certain intervals until he dies. Or more exactly, I'll kill him at the end of the script

 

void eat_cake()
{
sys.print("\nArne is eating cake\n");

if (poisoned_cake == 1) //Check if the cake is poisoned
{
sys.print("\nArne is poisoned and is taking damage\n");
sys.wait(5);
sys.print("\nHulk!\n");

 

Damage def //hurt Arne

sys.wait(5);

Damage def //hurt Arne

 

sys.wait(5);

Damage def //hurt Arne

 

sys.wait(5);

Damage def //hurt Arne

 

sys.wait(5);

 

$arne.kill(); //Kill Arne

}

}

 

 

 

It's the Damage def I need help with

Link to comment
Share on other sites

 

It already has that, but still doesn't work and does nothing when triggered.

I've made a fresh func_emitter, selected that fire particle and it's working alright. Although at the beginning it didn't show up because it was being covered up by a fog particle emitter, until I moved it clear. That would be the only explanation I can think of at the moment. If it still doesn't work I could send you a prefab of my working particle.

Link to comment
Share on other sites

I can grab a key through brushes, even though the material is solid (in this case, metal). wth? Is there some way to prohibit this?

 

I can't run DR atm, but if you download one of the prefab cabinets (the one with all the drawers that pull out), you'll find a non-frob texture plastered to the outside of the cabinet, on the surfaces through which you wouldn't expect to be able to frob an item inside the drawers.

 

Perhaps that will help if you place a brush made of that texture between the key and the player when you don't want the player grabbing a key.

Link to comment
Share on other sites

 

Thats prertty cool, looking foward to seeing your work then!

Heh, don't hold your breath. The maps I released are lost to the sands of time on ancient engines (Quake, HL1.) Always have good intentions, but I mostly do it for myself as a pastime. I like the building part, but my storytelling skills leave much to be desired and the last 10% of work required for a release (aka 90% of the effort) gets me every time.

 

We'll see how it goes this time. :unsure:

Link to comment
Share on other sites

Are the prefabs' frob blockers confirmed to work properly? I'm thinking of this statement from http://forums.thedarkmod.com/topic/15740-need-help-with-light-switches/?p=330051

 

 

Now, the odd thing is that if you use a "nodraw" texture on the frob blocker, the trace doesn't see it, and the switch is frobable. If you use a "nodraw_solid" texture, the trace sees it, and the blocker is frobbed. The code says that if the trace hits something that's frobable, the trace should see it, but apparently that doesn't work if the thing is non-solid.

This doesn't jive with the "nodraw" frob blockers you see on the sides and surfaces of the prefab writing cabinet. I wouldn't expect them to work. But since I've got a solution to my problem, I'll leave that for another day.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Glad I found this thread! I've been spending a lot of time lately in DR, after following Fidcal's A-Z tutorial I got almost obsessed with mapping and am working on a project now.

One of the most frustrating things for me is the camera view. Is there any way to decrease the movement speed when you are "flying around" by holding down a button perhaps? I find it difficult getting in position when working on fine scale things. Similarly, is there a way to focus the camera on something that you've highlighted through the grid view? As maps grow it becomes tiresome to manually fly everywhere :P

 

Finally a mapping question... during my test mission build following the A-Z guide I had such a pain with leaks everywhere I couldn't pinpoint that I started building inside a giant caulk cube. I realized this causes serious visportal related rendering problems if you have leaks, but if I did find roughly where a leak is, is it ok to "bandage" it with caulk or will it still render everything it since caulk is see-through?

 

Anyway I'm sure there will be a ton more questions as I go along, but this is the most important stuff atm :) Thanks in advance.

Edited by Bienie

My Fan Missions:

   Series:                                                                           Standalone:

Chronicles of Skulduggery 0: To Catch a Thief                     The Night of Reluctant Benefaction

Chronicles of Skulduggery 1: Pearls and Swine                    Langhorne Lodge

Chronicles of Skulduggery 2: A Precarious Position              

Chronicles of Skulduggery 3: Sacricide

 

 

 

Link to comment
Share on other sites

Just on the page before this, a similar question was asked, this was the comment:

 


Its advisable to build inside safe "boxes" that will keep your buildings contained from the void (basicly, you draw box rooms surrouding whole sections of your map). That will get rid of leak problems.

Never do this. If there is a leak, TDM will want to render everything in the enclosing box, killing performance.

Just fix the leak(s).

 

So, you will run into performance issues, if you do this, because everything will be rendered, if it is in the same space.

Link to comment
Share on other sites

It is okay to build things in big caulk cubes as a temporary measure (i.e. until you get your different areas up and running), just switch to correctly sealed mission segments as soon as you can. You will find leaks sooner, and will have a lot fewer things to worry about later down the line.

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

It is okay to build things in big caulk cubes as a temporary measure (i.e. until you get your different areas up and running), just switch to correctly sealed mission segments as soon as you can. You will find leaks sooner, and will have a lot fewer things to worry about later down the line.

 

That is what I thought. I'm starting to retrofit it already, to be proactive. However I'm noticing it's a gargantuan task, even if I've only been working on this particular section for about 6 hours. Trouble is I was using the 3-story Tudor inn prefab and hollowing it out bit by bit to make it a real inn. Problem is stuff is miles off grid, and I had to widen it cause it was just too thin to be realistic. I hope I can fix stuff with caulk bandages... I still don't quite get if caulk seals the "leaf", i.e. if I bandage a small hole with a caulk brush will it stop the other side from being rendered if they are supposed to be shut off with a portal? If not I'm in for so much work I might as well start from scratch -.-

 

Thanks for all your replies!

My Fan Missions:

   Series:                                                                           Standalone:

Chronicles of Skulduggery 0: To Catch a Thief                     The Night of Reluctant Benefaction

Chronicles of Skulduggery 1: Pearls and Swine                    Langhorne Lodge

Chronicles of Skulduggery 2: A Precarious Position              

Chronicles of Skulduggery 3: Sacricide

 

 

 

Link to comment
Share on other sites

Honestly, I still don't understand caulk. If you build a caulk wall through a room or a street, the two sides are sealed off from each other, but you can look right through the caulk and see the other side, because it gets rendered, but apparently with better performance than sealing the same gap with a visportal?

 

That's a bit too heavy for me.

  • Like 1

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

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 )
      · 2 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
       
      · 5 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
×
×
  • Create New...