Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Where does DR store layers? I had an issue with my one map version (dmap kept giving false positives for non-existent leaks) and so I created a copy (which solved the problem), but I've now lost all my layers.

 

Is there a file I can copy or alter to restore them, or do I have to manually create them all over again?

Link to comment
Share on other sites

They're in your <mymapname>.darkradiant file. You should just be able to rename it to match you new map name.

 

NB about the leaks: did dmap fail, or do you just have an old pointfile lying round? dmap often fails to delete its pointfile, so you can see a historic leak if you look at the pointfile. But if dmap doesn't fail with a console error, all is ok.

Link to comment
Share on other sites

Thanks SteveL for your speedy response. I have simply renamed the files, but as I have since added content to the map - DR has put some things in the wrong layers. Not a train smash, it will just take me some time to ensure that everything is back where it belongs.

 

EDIT:

 

On second thoughts, I have only now just realised the extent to which things have been jumbled up - even func_statics have been split across multiple layers. Guess it's time to start over with these layers... :mellow:

Edited by Dunedain19
Link to comment
Share on other sites

Hi guys,

 

I am currently working on a script and would like to randomise it a bit. Is there a simple way to set a variable as a random number (preferably in a specific range, like X = random number between 1 and 5)?

 

Thanks in advance for any help!

Link to comment
Share on other sites

From http://wiki.thedarkmod.com/index.php?title=TDM_Script_Reference

 

scriptEvent float random(float range);

    Returns a random value X where 0 <= X < range.
e.g.

 

myRandomVar = sys.random(4);
I don't know of any function that generates random whole numbers only, so your script will have to deal with float precision. Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

From http://wiki.thedarkmod.com/index.php?title=TDM_Script_Reference

 

scriptEvent float random(float range);

    Returns a random value X where 0 <= X < range.

 

I will try that. For me it does not really matter if it is only whole numbers or not. I just did not find the script event in the List. I am quite new to scripting and the list is a bit unclear for a newby like me.

Thanks!

Link to comment
Share on other sites

I have moveable_crate with custom model and clipmodel, and it should be carried by player in hands to info_tdm_objective_location. But while I have it in hands, it tends to drop by itself sooner or later. I'm not even sure what exactly produce this behavior becouse some map builds are free from this bug, and next time I change something and dmap -it happens again. Does [objective_ent 1] have comes with any clearing of position data to check if it in objective zone? It is a serious problem becouse player will swim up with it long distances and bug occurs every few seconds (sometimes more).

S2wtMNl.gif

Link to comment
Share on other sites

I've noticed a similar problem. I thought it was my mouse at fault (which it might still be). Beta-testing NHAT2, I couldn't hang on to the apple to give to the poor guy for more than a couple of paces. Later it worked ok. Other times I've had a problem holding on to a candlestick. Does anyone know whether grabber items are supposed to have a random chance of dropping out of the player's hands?

Link to comment
Share on other sites

Does anyone know of a way to make the splash screen not look so stretched? I've seen a few different FMs that have normal looking splash screens but when I open them in an editor its laid out the same as mine.

 

I know we are restricted to the 1024x1024 resolution but does anyone know of any tricks to not make it look so stretched horizontally?

Link to comment
Share on other sites

I've noticed a similar problem. I thought it was my mouse at fault (which it might still be). Beta-testing NHAT2, I couldn't hang on to the apple to give to the poor guy for more than a couple of paces. Later it worked ok. Other times I've had a problem holding on to a candlestick. Does anyone know whether grabber items are supposed to have a random chance of dropping out of the player's hands?

 

I added code in 2.03 to knock a moveable out of the player's hands when it bumps into an AI. (#3516)

 

This was to solve the problem of being able to push an AI around using a candle or apple or whatever.

 

While this looks suspiciously like the reason for the current problem, the player only drops the item if the object bumped is an AI, or is bound to an AI (pauldrons, weapons, etc.).

 

I don't know how close you have to get to the beggar with the apple you're trying to give him, but if you bump him with it, it's going to drop by design. Best to solve that problem by changing whatever's in the mission (entities, scripts) that makes that happen.

 

If there are no AI around, and you're still dropping things, file a bugtracker for it.

Link to comment
Share on other sites

Yes, especially the bit at the beginning where you couldn't pick it up again. You can just about lift it but it slides out of the hands again immediately like a wriggling trout.

 

Edit: or rather, like an oiled cannonball. For what's it's worth, to me the objects I've been temporarily unable to lift have "felt" very heavy.

Link to comment
Share on other sites

Hi,

 

the sys.floor( sys.random( 6 ) ) worked perfectly well. Thanks for the help! But now I have another problem: I want my script to have three parts and do not know how I can set the conditions: I planned it to have: if Value < 5 do part 1; if value = 5,6,7,8,9 do part 2 and set value = 100; if value = 100 do part 3. Now I do not know how to set up the second part. I could just copy/paste this part five times and set the condition to each of the five values, but this would make it quite long and unclear. Is there a way to tell the script, that it can be any of these five numbers in a single line?

Link to comment
Share on other sites

if (value > 4 && value < 10)
{
   //perform stuff here
}
for integer-like values. For floats use

if (value >= 5 && value <=9)
{

}
Together with the first case it gets even shorter (integer version here)

if (value < 5)
{
  //first case
}
else if (value <10) //code only enters here if first case didn't match
{
  //second case
}

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

Two queries:

 

1. Is there a way to have there be a delay between the moment when an light entity is targeted for switching off (i.e. a valve is turned) and when it actually goes off?

 

2. Related to this, is there a way to have a light entity dim into being extinguished? As if it is being slowly deprived of its energy source i.e. gas.

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

      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.
      · 1 reply
    • 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
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...