Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

I think I sussed the stackable/crash issue. You have to define a new Entity, and then make your presents use it. So, in \reluctantbenefactionv1\def\custom.def, define this:

 

entityDef my_present
{
"inherit" "atdm:moveable_custom_item"
"editor_displayFolder" "Items"
"bouncyness" "0.02"
"friction" "0.2"
"inv_category" "Special"
"inv_droppable" "1"
"inv_icon" "guis/assets/hud/inventory_icons/present"
"inv_name" "Christmas Parcel"
"inv_stackable" "1"
"mass" "30"
"model" "models/present.ase"
"objective_ent" "1"
"snd_acquire" "frob_loot"
}
After making this change, be sure to exit DR and TDM to make sure the change is loaded. Next, in DarkRadiant, your 3 presents should point to my_present in the classname:
post-2024-0-41597200-1545521492_thumb.png
You only need to specify those 4 args (because the rest are defined in the my_present entity). As before, the 'name' arg should be different for each present ('present', 'present1', present2').
I made these changes, and I could stack and drop presents to my heart's content.
  • Like 1
Link to comment
Share on other sites

 

I think I sussed the stackable/crash issue. You have to define a new Entity, and then make your presents use it. So, in \reluctantbenefactionv1\def\custom.def, define this:

 

entityDef my_present
{
"inherit" "atdm:moveable_custom_item"
"editor_displayFolder" "Items"
"bouncyness" "0.02"
"friction" "0.2"
"inv_category" "Special"
"inv_droppable" "1"
"inv_icon" "guis/assets/hud/inventory_icons/present"
"inv_name" "Christmas Parcel"
"inv_stackable" "1"
"mass" "30"
"model" "models/present.ase"
"objective_ent" "1"
"snd_acquire" "frob_loot"
}
After making this change, be sure to exit DR and TDM to make sure the change is loaded. Next, in DarkRadiant, your 3 presents should point to my_present in the classname:
You only need to specify those 4 args (because the rest are defined in the my_present entity). As before, the 'name' arg should be different for each present ('present', 'present1', present2').
I made these changes, and I could stack and drop presents to my heart's content.

 

 

You're a godsend!!

I got it working perfectly as well now. Thanks for giving me the defintion code, that was the part I couldn't figure out based on the different wiki pages I was looking through. Turns out it was a lot simpler than I imagined... live and learn ^^

 

*edit: Actually the game still crashes when the map is picked up after the presents are, but that is pretty minor... I think I will just let the map be in the player's possession from the start, and instead have a little readable that has the actual delivery orders on it.

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

  • 2 weeks later...

I have problem with custom textures. While some looks as they should, others appear with terribly distorted colours. I'm using as a template material like this:

textures/painting_1
{
    wood

    diffusemap      textures/paintings1

    {
        if ( parm11 > 0 )
        blend       gl_dst_color, gl_one
        map         _white
        rgb         0.40 * parm11
    }
    {
        if ( parm11 > 0 )
        blend       add
        map         textures/paintings1
        rgb         0.15 * parm11
    }

  // TDM Ambient Method Related
  {
    if (global5 == 1)
    blend add
    map        textures/paintings1
    scale      1, 1
    red        global2
    green      global3
    blue      global4
  }
  {
    if (global5 == 2)
    blend add
    program  ambientEnvironment.vfp
    vertexParm    0    1, 1, 1, 1    // UV Scales for Diffuse and Bump
    vertexParm    1    1, 1, 1, 1  // (X,Y) UV Scale for specular
    vertexParm    2    global2, global3, global4, 1

    fragmentMap    0    cubeMap env/gen1
    fragmentMap    1    _flat      // Bump
    fragmentMap    2    textures/paintings1      // Diffuse
    fragmentMap    3    _black      // Specular
  }
}

but image that should look like showed on right side, looks like on left. I have experimented even with stock painting and it still have broken at least rgb balance, but look better. (you can see what's left from custom portrait above the "stock" sorceress painting).

 

5wKTy7x.jpg

Edited by ERH+

S2wtMNl.gif

Link to comment
Share on other sites

For quite a some time now you don't need the code below in your shaders:

 

 

{
if (global5 == 2)
blend add
program ambientEnvironment
.vfp
vertexParm
0 1, 1, 1, 1 // UV Scales for Diffuse and Bump
vertexParm 1 1, 1, 1, 1 // (X,Y) UV Scale for specular
vertexParm 2 global2, global3, global4, 1

fragmentMap 0 cubeMap env/gen1
fragmentMap
1 _flat // Bump
fragmentMap 2 textures/paintings1 // Diffuse
fragmentMap 3 _black // Specular
}

 

Apart from that it's just a diffuse and frob code. Not sure what makes it look so green.

Link to comment
Share on other sites

.tga shows as green, .dds are just black.

That reminds me of http://forums.thedarkmod.com/topic/8747-tweaks-to-frob-highlight/page-9?do=findComment&comment=187724 -- but since it involves an unused renderprog, it may not be much of a lead. Does taking out the conditional stages change anything? How about replacing the diffusemap line with some sort of blend stage that doesn't react to light?

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

.tga shows as green, .dds are just black.

 

 

Hmm, there shouldn't be a difference.

 

Well, here are a few things to test to narrow it down.

 

replace "diffusemap textures/paintings1" with one of the core mod paintings. If that has the same problem, then we can rule out your texture file as the issue. If not, it suggests something might be wrong with your .tga export.

 

Copy a working bumpmap stage and add it to your material. This will rule out a missing bumpmap as an issue.

Link to comment
Share on other sites

Is there a way to read out the entity an item was used on via script? I want the player to use a specific item on several different entities and want to prevent the use on one entity several times. I am working with the "used_by" spawnarg and the "used_action_script" and would have the script know, which entity the item was used on.

Link to comment
Share on other sites

If the intention is that the player uses the inventory item by frobbing the world item (for this make sure inv_used_on_frob is set to true), then you could retrieve the entity it got used on by checking what is currently frob-hilighted. Or you go the other way round, use the frob_action_script on the entities placed in your map and let them check which inventory item is currently selected.

 

See also here: http://wiki.thedarkmod.com/index.php?title=Inventory

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

The first was exactly what I was looking for. Thanks!

As it is quite some time that I tried my hands on a script, am I right in assuming that the correct syntax would be: "entity CurrentlyFrobbed = $player1.getFrobbed()" to define the frob highlighted entity as "CurrentlyFrobbed"? Or rather completely: To set the entity currently highlighted unfrobable:

entity CurrentlyFrobbed = $player1.getFrobbed();
CurrentlyFrobbed.setFrobable(0);

Does that look right? I still have problems to know which argument has to go where :blush:

 

EDIT: While I am at it: How can I display a message on screen via script? I know that it is possible with the atdm:gui_message, but I would like a variable in the text (i.e. "X/3 objects interacted"), so I need a way to change the text in the message via script. I know this is possible and I have done it myself, but I cannot remember how.

Edited by Destined
Link to comment
Share on other sites

The first was exactly what I was looking for. Thanks!

As it is quite some time that I tried my hands on a script, am I right in assuming that the correct syntax would be: "entity CurrentlyFrobbed = $player1.getFrobbed()" to define the frob highlighted entity as "CurrentlyFrobbed"? Or rather completely: To set the entity currently highlighted unfrobable:

entity CurrentlyFrobbed = $player1.getFrobbed();
CurrentlyFrobbed.setFrobable(0);

Does that look right? I still have problems to know which argument has to go where :blush:

 

EDIT: While I am at it: How can I display a message on screen via script? I know that it is possible with the atdm:gui_message, but I would like a variable in the text (i.e. "X/3 objects interacted"), so I need a way to change the text in the message via script. I know this is possible and I have done it myself, but I cannot remember how.

 

That logic does look fine to me.

 

About the other question, there's ages that I have used idScript and specially TDM version of it, so i can't tell you what script function you would use to print values to the gui it self in TDM, in fhdoom I use the message system (is just a windowdef with a text "gui::message") of the player HUD to show text tips on screen and just use:

hud->SetStateString("message", examine_message.c_str());
hud->HandleNamedEvent("Message"); 

To show values in real time on the player screen (development/ debug purposes) I changed the c++ code by using this tutorial, don't know if that was really necessary but it works for me.

 

http://web.archive.org/web/20050828101016/http://www.planetdoom.com:80/d3cc/tut04.html

Edited by HMart
Link to comment
Share on other sites

sys.println("your_text") allows you to print something to the console. It will be visible on screeen without you having to open the console everytime if you enter con_noprint 0 to the console. This what I do if I need debugging intel from my scripts.

 

Your script looks good. Note that getFrobbed my also return the entity currently held by the player (e.g. is in his grabber) as it is also frobhilighted in this state. Depends on the usecase, though, whether this is important.

  • 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

Thanks, I will test if I will keep that in mind when I will test it.

 

Regarding the message:

@HMart: I believe that it was easier and that I did not have to fiddle with the GUI for that. It was pretty simple, which makes it all the more frustrating :( I should start to write that stuff down...

 

@Obsttorte: It was not meant as a debug option for me (although it is good to know that this is possible), but as a tracker for the player. Something like: "Objective: Steal three apples." Each time an apple is picked up, a message appears that reads "[current number] of three apples found". With atdm:gui_message I can display a message, but I am not sure how to include a variable (I am pretty sure I used this entity, though).

Link to comment
Share on other sites

In Doom 3 idSoftware used c++ for the most part to include values into gui text strings, using the va("sometext_%i", someIntvalue) function so they never bother to include a idScript equivalent, but I think you can use this:

windowDef Desktop
{
	rect	0 ,0 ,640 ,480
	nocursor	1
	visible	1
        
        // runs every frame!!
	onEvent{
            if("gui::someValue" == 1 ){
		set "valueWindow::text" "1" ;
            }
            if("gui::someValue" == 2 ){
               set "valueWindow::text" "2" ;
            }
            ...
	}

        windowDef valueWindow{
              rect	288,240,32,32
              text "0" 
        }
}

Then on script use the entity.setGuiFloat( "someValue" , 2)

Hope this helps.

sys.println("your_text") allows you to print something to the console. It will be visible on screeen without you having to open the console everytime if you enter con_noprint 0 to the console. This what I do if I need debugging intel from my scripts.

Your script looks good. Note that getFrobbed my also return the entity currently held by the player (e.g. is in his grabber) as it is also frobhilighted in this state. Depends on the usecase, though, whether this is important.


Yes I know about the sys.println (in reality i use c++ with gameLocal.Printf("your text %i", value)) and I used it all the time, but it does have the nasty habit of spamming the console with messages, specially when you print runs inside a loop and imo is very distracting, seeing the constant flow of text, where's the onscreen gui method i implemented by that tut, is fixed and it also supports coloring the text like the console text, is really a case of preference, is not really necessary to implement but now that I did, i use it for some player debug info.

Edited by HMart
Link to comment
Share on other sites

@Obsttorte: It was not meant as a debug option for me (although it is good to know that this is possible), but as a tracker for the player. Something like: "Objective: Steal three apples." Each time an apple is picked up, a message appears that reads "[current number] of three apples found". With atdm:gui_message I can display a message, but I am not sure how to include a variable (I am pretty sure I used this entity, though).

Then you should check one of the missions of Goldwell iirc. He added secrets to one of his missions and everytime the player found one, a message like yours appeared telling the player how many secrets he has already found. Dunno the exact mission, though.

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 noticed one weird inconsistency about door system: there are snd_open and snd_opened sounds, and they work as expected (sound when you start opening the door, and at the end of it), but for some reason closing works in a different way. There's only snd_close, and it doesn't start when door begins to close, it plays at the end of it. So you can have a squeaky wooden door that has the sound of turning the knob and the squeaky sound that comes next, but you can't have the same for closing. It has to be silent and you only hear the sound of the door being shut. Why is that?

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

The training mission apparently uses an individual message for each potion that is found, which is what I wanted to avoid.But this gave me the nudge in the direction, what I acutally need: a means to change the "text" spawnarg in game, which in turn led me to the setKey command (bless the person who made the TDM Script Reference; it is long and cluttered, but with a bit of searching, you usually find what you are looking for). With the lines

$atdm:gui_message.setKey("text", Variable+" of 3 found");
$atdm:gui_message($player1);

it is possible to use a atdm:gui_message entity, change the text during gameplay and show it via script. Now I only have to find the GUI that suits my aesthetic needs (the standard used for this is a pergament background in the upper left corner, while I would prefer the style of message like the NEW OBJECTIVE with white letters and no background in the upper middle of the screen), but I think I will find that myself. Thanks all for their help! I will add a note to the Popup Messages Wiki page, that this can be done. Maybe it will come in handy for other people too.

Edited by Destined
Link to comment
Share on other sites

Check the tdm_hud.gui file for popups.

 

I noticed one weird inconsistency about door system: there are snd_open and snd_opened sounds, and they work as expected (sound when you start opening the door, and at the end of it), but for some reason closing works in a different way. There's only snd_close, and it doesn't start when door begins to close, it plays at the end of it. So you can have a squeaky wooden door that has the sound of turning the knob and the squeaky sound that comes next, but you can't have the same for closing. It has to be silent and you only hear the sound of the door being shut. Why is that?

I am not sure whether there is any plan behind this. Often things got added to fulfill a specific need, but one doesn't always consider whether it makes sense as a concept as whole. Or it gets overseen. However, if you don't mind the door making the same noise when opening and closing, you can use snd_move.

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

Snd_move helps a bit, but as you say, it works both for opening and closing.

 

Often things got added to fulfill a specific need, but one doesn't always consider whether it makes sense as a concept as whole.

 

I guess that makes sense for fan project overall, but cases like that (core systems) it needs some extra care, as it will be hard or impossible to change later. It's kinda too late for that, but it probably should have been something like snd_open / snd_opening, snd_closing / snd_closed. This way you have a bit more freedom, e.g. you can make more simple system, with just snd_opening/closing, where the two sounds include pressing the handle and door squeaking / squeaking and doors being shut. The downside is that the opening / closing time has to be systemic as well, it has to match the sounds. Or, you can have more complex 4 sound setup and you can change the door opening/closing speed.

  • 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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • 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
×
×
  • Create New...