Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


Recommended Posts

7 hours ago, Obsttorte said:

The value of the lightgem is passed to the gui via the code. There is not much to improve here.

But custom scripts can't access it. That's because you need the overlay handle of the GUI element using that GUI float. I tried using the custom overlay specific to my mod, and unsurprisingly $player1.getGuiFloat(mygui, "gui::lightgem_val") always returns 0.

Link to post
Share on other sites
  • Replies 10.1k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

So I have this gigantic scorpion, it is made out of pendulums bound together. I had an idea about dragging whole thing through a piled up crates (pretending to be stone blocks in a wall), but it looks

I'm just going to make the lute player an undead immortal skeleton called Ralph who is eternally bound to play his lute in the tavern, the residents are used to him now so they just happily co-exist a

So I just did a little test because I was curious to know this as well.   So far i've figured out that the mesh we see in the mirror is located as "models\md5\chars\thief\tdm_ai_thief.md5mesh" and if

Posted Images

@Obsttorte, I'm sure that "get" functions are more easily implemented than callbacks, so if I was proposing a specific API expansion, that would be the place to start.

@Dragofer, thinking further about the Signal system as currently defined, I'm not sure what it brings to the table. Is there any thing you can do with it that you can't do more gracefully by using entity spawnargs like "frob_action_script"?

Link to post
Share on other sites
1 hour ago, MirceaKitsune said:

But custom scripts can't access it. That's because you need the overlay handle of the GUI element using that GUI float. I tried using the custom overlay specific to my mod, and unsurprisingly $player1.getGuiFloat(mygui, "gui::lightgem_val") always returns 0.

The GUI number is something below 10.

try 1, 2, 3, etc. until you find the one that works.

Link to post
Share on other sites

@Geep The signal system supports different kinds of events than the action script system. Signals can i.e. watch for an entity getting touched by something else (at least the player), an entity getting removed or a func_mover getting blocked. Since it's quite old it doesn't know about "frobbing".

Both systems are covered as sub-topics on this page A to Z Scripting: Ways of calling a script

Link to post
Share on other sites

Oh, I thought touch = frobbed when I read the Signals article.

BTW, @Dragofer, I just became aware of the AI spawnargs death_script and ko_script (or is it knockout_script?). Probably need to include that in A-Z too.

  • Like 1
Link to post
Share on other sites
1 hour ago, grayman said:

The GUI number is something below 10.

try 1, 2, 3, etc. until you find the one that works.

Is it not something predefined? It seems unsafe to guess and use this way, if it might change in the future and then the mod would break and need to be edited to reflect a new handle. Overall it sounds like it might work, but is pretty hacky to use in this form. I'll think if to at least write down some suggestions in this regard.

Link to post
Share on other sites
12 minutes ago, MirceaKitsune said:

Is it not something predefined? It seems unsafe to guess and use this way, if it might change in the future and then the mod would break and need to be edited to reflect a new handle. Overall it sounds like it might work, but is pretty hacky to use in this form. I'll think if to at least write down some suggestions in this regard.

You could cycle through each GUI handle until you find one that gives you a non-0 result for the lightgem value. That should be future-proof.

For the rare cases where the mission has no ambient light and the player starts in total darkness, you could keep cycling through those 10 handles until the player moves into an area with light, allowing you to finally identify the correct GUI.

Link to post
Share on other sites

I am still fuzzy on the utility here.

For custom HUD you can just pass the gui::lightgem_val

For AI, they already check the lightgem value when performing searches. Why not just create a custom AI def and (if needed)

script to modify it's behavior?

To "enhance" the player by lowering the lightgem there is already a lightgem modifier.

What do you need to implement that doesn't involve:

1) Showing the lightgem in a custom HUD

2) Letting AI know your lightgem value

https://wiki.thedarkmod.com/index.php?title=Visual_scan

3) Changing your lightgem value relative to it's current value?

userEntity.setLightgemModifier("lantern", value ));

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to post
Share on other sites
6 hours ago, MirceaKitsune said:

But custom scripts can't access it. That's because you need the overlay handle of the GUI element using that GUI float. I tried using the custom overlay specific to my mod, and unsurprisingly $player1.getGuiFloat(mygui, "gui::lightgem_val") always returns 0.

I know. I was refering to Geeps proposal for using it in a custom gui. That case is already covered by the code.

The reason getGuiFloat returns zero is that you are probably using it wrong. The first argument is the gui handle of your gui. I am also not sure whether the second argument is "gui::lightgem_val", it could also be just "lightgem_val".

3 hours ago, MirceaKitsune said:

Is it not something predefined? It seems unsafe to guess and use this way, if it might change in the future and then the mod would break and need to be edited to reflect a new handle. Overall it sounds like it might work, but is pretty hacky to use in this form. I'll think if to at least write down some suggestions in this regard.

As stated earlier it is GUI_HUD (corresponding to the integer 1 iirc, but you can use GUI_HUD). It is predefined and very unlikely to change.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

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 post
Share on other sites

I've had a small trigger_once that fires a script function OK when the player walks into it, but now I'm trying to make it both persistent and auto-reset when the player is outside it, so it can be used again. I know this can't be done with trigger_once, which gets removed from the game once triggered. But I was surprised that trigger_multiple didn't do it either, even with wait time of either "-1" or "32000" specified.

So I'm moving on to try info_tdm_objective_location for this. But I'd like to change the Triggers wiki to be more helpful. Would the following be the correct understanding?  Instead of:

trigger_multiple

Similar to trigger_once but will activate again and again, use "Wait" spawnarg to control how many seconds between triggerings.

...replace with...

trigger_multiple

Similar to trigger_once but will trigger repeatedly as long as the entity that triggered it remains within its volume, after which the trigger_multiple is removed from the map. The "wait" spawnarg controls the seconds between triggerings. A wait of "-1" makes it equivalent to trigger_once.

 

Link to post
Share on other sites

Trigger_multiples can be re-used as often as one wants and won't be deleted from the map, unless I'm very mistaken. If you want to use the trigger_multiple as a resettable trigger_once, you might be able to toggle it off by triggering it. Might have to infer that the player is still inside, i.e. by checking if there are 2 trigger events within "wait" seconds of each other.

  • Like 1
Link to post
Share on other sites

OK, so a lot of questions. I won't change the wiki. In the FM, I re-implemented using "within radius" objectives, all working well. Unlike info_tdm_objective_location, which I bug-reported as apparently broken last year.

 

Link to post
Share on other sites

I have been hitting my head on this for days. I can't get the speaker to play any sound (custom sounds or TDM standalone sounds) using either right-click "create speaker" or "create entity".

I made a sndshd file with my custom sound and a text file with the sound as a wav and ogg --neither worked. So I made a speaker using the create speaker, and still have no sounds. My debugging info says that the default cannot be found.

Any ideas, please?

 

I'm runing DarkRadiant 2.9 on Linux Mint x64 and TDM 2.8

 

mmij-nosound.txt

Link to post
Share on other sites

My first advice is, it might be good to open up another FM and see how it set up a custom speaker and double check every element with the tutorial in case you misinterpreted something. It could be something like a typo in a spawnarg in the speaker, or in the soundshader, or not have the shader in the right folder, or it not referring to the proper folder where the sound file is, etc.

Worst case, if you still can't figure it out, then you can just flat out copy and paste a custom speaker & all the relevant stuff from another FM into your map and change it from there.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to post
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.


×
×
  • Create New...