Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

It looks like you're right. I can't find any code for it.

 

I was about to offer to pick that one up -- a quick enough fix -- except that it's not at all clear what the intended behaviour was.

  • Remove the item from the game?
  • Drop it at the player's feet?
  • In the case of stackables, remove 1 item or all of them?

And the editor tip mentions objectives, which have their own management system. They're not inventory items.

  • Like 1
Link to comment
Share on other sites

I was about to offer to pick that one up -- a quick enough fix -- except that it's not at all clear what the intended behaviour was.

  • Remove the item from the game?
  • Drop it at the player's feet?
  • In the case of stackables, remove 1 item or all of them?

And the editor tip mentions objectives, which have their own management system. They're not inventory items.

 

You could have a spawnarg "droptofloor" or something similar and if its set to 1 the item drops to the floor, if its set to 0 (default) it deletes it entirely out of the game. To solve the issue of stackables also use a spawnarg "quantitytoremove" or something similar and once again the player can set how many get removed when the entity is triggered.. I would say by default set it to 1 and yeah.

 

And thank you to everyone who helped with the script ideas :) you guys are always so helpful!

Edited by Goldwell
Link to comment
Share on other sites

Oh and for future reference (if someone is searching through these threads) here is the working way to remove the key with scripts

 

void key_remove()
{
$player1.replaceInvItem ($KEYNAME, $null_entity);
$player1.getNextInvItem();
} 

 

Simply replace "KEYNAME" with your keyname and its good to go.

Edited by Goldwell
  • Like 1
Link to comment
Share on other sites

I recommend adding another line in that script to flip to the next inventory item. This is because sometimes the icon of the removed item will stay showing up on the inventory if you don't do 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 recommend adding another line in that script to flip to the next inventory item. This is because sometimes the icon of the removed item will stay showing up on the inventory if you don't do this.

 

Good idea and done!

Link to comment
Share on other sites

Hey guys, I'm fairly new to these forums and to the Dark Radiant world in general. I've been spending the past few months working (slowly) on a map and learning how DR works. I know this question has been answered in this thread before but for the life of me I still can't figure it out how to do it. Can someone give me a step by step on how to make moon lit windows like these:

Thanks!

Link to comment
Share on other sites

I have a video briefing, that works just fine. When it ends, I get to the objectives screen as I should.

 

However, if I skip the briefing with esc, I go to the text-only briefing screen (an empty parchment). Same thing if I go back from the objectives screen.

 

Does anyone know how to fix this, i.e. esc goes directly to the objectives screen and back starts the video briefing from start.

Thanks!

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Question: Can't AI open doors inherently, or do you have to add a spawnarg for them to do that? I thought it was automatic.

Basing this on the wiki: you either have to give them a key or set a spawnarg on the ai, "can_unlock1" "<doorname>"

 

I've not tried it, but I'm sure you'll be able to specify more doors using "can_unlock2", "can_unlock3" etc.

Link to comment
Share on other sites

Giving them a key won't work. can_unlock will do the trick. can_unlock2 etc. will also work if you want the ai to be able to lock/unlock several doors.

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 a script

 

void trowel_dig()
{
sys.println("trying to find trowel");
	if ($player1.getCurInvItemName() = "trowel")
	{
  sys.println("trowel is there!");
	}
}

 

But when I activate the script it seems to print both console lines "searching for trowel" and "trowel is there" but it shouldn't because I have yet to pickup the trowel.

 

Basically i'm trying to make a script that does the following:

Is the trowel in the players inventory and currently highlighted?

yes = activate trigger

no = nothing happens

Edited by Goldwell
Link to comment
Share on other sites

Hm, that really should work. This is the code I use to do something similar:

 

if ($player1.getCurInvItemName() == "Holy Symbol")

{

$player1.callGui($player1.getInventoryOverlay(), "onInvPositiveFeedback"); //show's the "used object" green highlight.

$convo.activate($player1); //trigger the "convo" entity.

sys.wait(3); //this is to stop the player from repeatedly frobbing the object successfully.

}

else

{

startSound("snd_fail", SND_CHANNEL_ITEM, false); //triggers the fail sound defined in the spawnarg.

}

}

  • Like 1

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

Instead of this:

 

if ($player1.getCurInvItemName() = "trowel")

 

try this, with two equal signs:

 

if ($player1.getCurInvItemName() == "trowel")

 

Ah that was the problem! Thank you :)

 

Also thanks for the help too Moonbo!

Link to comment
Share on other sites

Yeah, an assignment (one = ) always returns true.

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 said

"Yes, they open doors automatically.

 

Do you have an example where they don't? "

 

Well, one of my testers had a guard chase him behind a stable door, player escaped, but the guard stood behind the unlocked door doing nothing? Had to restart.

Maybe just a glitch. Just wondered if I needed to add a spawnarg on the guard AI. Didn't think so.

Thanks

Quando omni flunkus moritati" ("When all else fails, play dead")

Halloween Contest Winner 2014

Link to comment
Share on other sites

Another question: Can you NOT turn off a steambot? I thought a water arrow would work, but it didn't. I might have to remove it if it can't be disabled. Can you put a switch on it? To turn off?

Quando omni flunkus moritati" ("When all else fails, play dead")

Halloween Contest Winner 2014

Link to comment
Share on other sites

Another question: Can you NOT turn off a steambot? I thought a water arrow would work, but it didn't. I might have to remove it if it can't be disabled. Can you put a switch on it? To turn off?

 

Traditionally you can kill them with swords or fire.

  • Like 1
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 )
      · 1 reply
    • 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
       
      · 3 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...