Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


Recommended Posts

Having a few issues with pesky assets I can't locate in the browser. Where do I find:

  • The telescope model. I know there was a large one you could put on the ground.
  • A denser moving cloud texture, ideally one that looks good lit by the moon.
  • A song for the lute player. Despite all the trouble I went through with him, I didn't yet find a guitar to put on his speaker.
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

Thanks for the advice about the tent, guys. Finally got around to (mostly) fixing it; shadows were indeed the problem.    

Posted Images

So there is no good one by default? I'll get one from OGA then. What about the other assets?

Also I can't find the property to make a piece of loot noticed by the AI when it's stolen. How do I make guards see when a large painting was ripped off its frame?

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

Also I can't find the property to make a piece of loot noticed by the AI when it's stolen. How do I make guards see when a large painting was ripped off its frame?

Take a look at this: https://wiki.thedarkmod.com/index.php?title=Alert_%26_Suspicion_Triggers#Missing_or_Moved_Objects.2C_Absence_Markers

  • Like 1
Link to post
Share on other sites
3 hours ago, MirceaKitsune said:

So there is no good one by default? I'll get one from OGA then. What about the other assets?

Are you talking about the spyglass?

The model for the loot version is at spyglass/fancy.

Another is at player_equipment/spyglass.

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

Are you talking about the spyglass?

The model for the loot version is at spyglass/fancy.

Another is at player_equipment/spyglass.

Was talking about a song for the lute player. I'm not looking for a spyglass but the telescope, the large one.

Link to post
Share on other sites

For hours now I'm trying to find out how to get a predefined value in ::init to be "known" in an other part of the script. Been looking at other scrips and don't understand what I'm doing wrong.

I'm just trying to sys.println() a predefined number to see if what I'm doing works ... but I can't even do that : D

#ifndef __REUSABLE_SCRIPT__
#define __REUSABLE_SCRIPT__

object poltergeist_script
{
	float	clicks; 

	void	init();
	void	OnOff();

};

//init
void poltergeist_script::init()
{
	ResponseAdd(STIM_TRIGGER);
	ResponseSetAction(STIM_TRIGGER,"OnOff");
	ResponseEnable(STIM_TRIGGER,1);
	clicks = 2;
}

//OnOff
void poltergeist_script::OnOff()
{
	sys.println(clicks);
}

#endif __REUSABLE_SCRIPT__

Whatever number I put in void poltergeist_script::init() / clicks , I  keep getting 0 in the console : (

Edited by STRUNK
Link to post
Share on other sites
2 hours ago, MirceaKitsune said:

Was talking about a song for the lute player. I'm not looking for a spyglass but the telescope, the large one.

I found a telescope in The Accountant 2. It's not a TDM asset, so ask Goldwell about borrowing it?

Link to post
Share on other sites
19 hours ago, STRUNK said:

For hours now I'm trying to find out how to get a predefined value in ::init to be "known" in an other part of the script. Been looking at other scrips and don't understand what I'm doing wrong.

I'm just trying to sys.println() a predefined number to see if what I'm doing works ... but I can't even do that : D






#ifndef __REUSABLE_SCRIPT__
#define __REUSABLE_SCRIPT__

object poltergeist_script
{
	float	clicks; 

	void	init();
	void	OnOff();

};

//init
void poltergeist_script::init()
{
	ResponseAdd(STIM_TRIGGER);
	ResponseSetAction(STIM_TRIGGER,"OnOff");
	ResponseEnable(STIM_TRIGGER,1);
	clicks = 2;
}

//OnOff
void poltergeist_script::OnOff()
{
	sys.println(clicks);
}

#endif __REUSABLE_SCRIPT__

Whatever number I put in void poltergeist_script::init() / clicks , I  keep getting 0 in the console : (

I don't script for ages but I don't remember the println function being able to printing floats directly?!

I think the right code is this:

sys.println("Clicks are: " + clicks ) ;

 

edit: I'm dumb I went to see some old scripts of mine and yes you can print floats directly (by directly I mean you don't need to convert them to a string), it seems the println func needs a string also defined to work well? I updated my example script code, it was also badly formatted, like I said I don't doom script for ages... :P 

Edited by HMart
Link to post
Share on other sites
12 hours ago, STRUNK said:

 Whatever number I put in void poltergeist_script::init() / clicks , I  keep getting 0 in the console : (

This is actually a bug with scriptobjects which set up their own S/R the way you've done in your init. I was stumped on this for ages, wondering why the variables don't carry over between functions (always 0), until it occurred to me to use a different method to call the script object i.e. via the frob_action_script spawnarg.

  • Thanks 1
Link to post
Share on other sites

@Dragofer

It works now I copied things from the custom_func.def. This is really very strange as when I look to the .defs for @VanishedOne's triggers, they are set up as what I had .. and they do work. Maybe it's only buggy in the reuseable script. I also tried to give my script an other name, but that didn't work either .. although the wiki says it should work ... see "Discovery (or, why is TDM ignoring my script file?)" https://wiki.thedarkmod.com/index.php?title=Scripting_basics

Is that also a bug, or did I just do something wrong and should it work?

Edited by STRUNK
Link to post
Share on other sites

Comparing my script to the one above, the only thing that stands out is that my equivalents to OnOff() seem to have parameters, e.g.

void TriggerNextInSequence(entity me, float threadnum);

If anyone likes this telescope (CC-BY-NC), I've already done the format conversion for TDM.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites
On 10/29/2020 at 9:34 PM, MirceaKitsune said:

At this stage I need help with one more spooky effect: I want to make a particle blood spawner, pretty much an entity that constantly leaks blood once triggered. If possible I'd like the particles to spawn decals on surfaces they touch so they get stained with blood from the fountain, as happens when you hit an AI with the sword or an arrow. Is there a default particle entity for that?

The most id-like way is probably via the FX system. You can access it via func_fx. However, the decal splat range will be limited to < 8 units and the decal will only splat directly downwards. (The usual story: id set it up for the demon-spawning effects in D3 and didn't make it a conveniently general system because they didn't need to.)

The other way would involve some sort of synchronised particle emitter and func_splat. However, I have a vague recollection that in my tests func_splat didn't splat all entity classes; splatting $world should work, anything else needs testing. (Also it seemed to ignore decalInfo and impose its own decal fade time.)

After that you're in the territory of esoteric work-arounds like launching a custom projectile from an atdm:func_shooter.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to post
Share on other sites
20 hours ago, STRUNK said:

For hours now I'm trying to find out how to get a predefined value in ::init to be "known" in an other part of the script. Been looking at other scrips and don't understand what I'm doing wrong.

I'm just trying to sys.println() a predefined number to see if what I'm doing works ... but I can't even do that : D


#ifndef __REUSABLE_SCRIPT__
#define __REUSABLE_SCRIPT__

object poltergeist_script
{
	float	clicks; 

	void	init();
	void	OnOff();

};

//init
void poltergeist_script::init()
{
	ResponseAdd(STIM_TRIGGER);
	ResponseSetAction(STIM_TRIGGER,"OnOff");
	ResponseEnable(STIM_TRIGGER,1);
	clicks = 2;
}

//OnOff
void poltergeist_script::OnOff()
{
	sys.println(clicks);
}

#endif __REUSABLE_SCRIPT__

Whatever number I put in void poltergeist_script::init() / clicks , I  keep getting 0 in the console : (

As VanishedOne already pointed out I think the issue is that your response function "OnOff" does not have any arguments. My interpretation, as the script gets performed anyway, is that the script compiler considers the function to be of "global" scale (in a sense as independent as to what entity it is called on) and ignores the value of the member variable clicks. Note that this variable is defined for all entities of type poltergeist_script, but the compiler can't know that it also has the same value for all of those entities. I can't say, though, why the code behaves like that.

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 want to give a spawned object the name of the trigger I'm making + something, to make it unique.

The name of the trigger is "trigger_poltergeist_1" and the name of the spawned object should be "trigger_polergeist_1_light". So when I have more then one of these triggers it would be "trigger_poltergeist_2_light" etc.

How can I do that?

Link to post
Share on other sites
56 minutes ago, STRUNK said:

I want to give a spawned object the name of the trigger I'm making + something, to make it unique.

The name of the trigger is "trigger_poltergeist_1" and the name of the spawned object should be "trigger_polergeist_1_light". So when I have more then one of these triggers it would be "trigger_poltergeist_2_light" etc.

How can I do that?

You can change the name via the function setName(string newName). getName() returns the name of the entity.

 

So if the trigger entity is the spawning entity the code would look like this

[code]

entity myEntity = sys.spawn(entityToSpawn); //pass the proper entity def as argument

myEntity.setName(getName());

[/code]

If the trigger is not the spawning entity but only initiates the spawn (via a global script call or a custom entity) you have to pass the trigger entity (or at least its name) to the function where the spawn is handled.

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

@Obsttorte

Ok thanx, did that, now I want to look if it works/print the new name. But this doesn't work:

    entity light = sys.spawn("light");
    light.setName(getName());

sys.println(light);

An other thing, it's also spawning a trigger hurt and I want mappers to give it a hurt value from the triggers spawnargs, only the value must be "damage_triggerhurt_x" (where x is a number) for the trigger_hurt to understand it, and I want mappers to only fill in the number, so I have to combine the key value (0 to 1000) with "trigger_hurt_" and make that into one variable/string. How to do that?

Link to post
Share on other sites

Ok, I got it now. The "name" I give it in my script is only a reference so I don't have to worry about spawned objects getting the same name.

    entity light = sys.spawn("light");
    light.setColor(color_x, color_y, color_z);
    light.setOrigin(obj.getOrigin());
    light.setRadius(80);
    light.bind(obj);

string myStr = light.getName();
sys.println(myStr);

I get a something like idLight_light_54 .. so that's already taken care of by the main script : )

Link to post
Share on other sites

I made the trigger_poltergeist : O

It was an idea and a little script from @MirceaKitsune and I turned into a trigger. Only thing is the stim response workaround and I would like to give the script an other name then tdm_reuseable_script .. but I had no success with that at the start, and didn't try anymore. Can some of you maybe test it and/or optimise the script, if needed?

Here is the .def .script and a custom .prt

tdm_fire_torch_small_blue.prtcustom_trigger.deftdm_reusable_script.scripttdm_custom_scripts.script

.script(s) go into your script folder, .def goes in your def folder and .prt goes in your particles folder. If you don't have these folders, create them : )

 

 

Edited by STRUNK
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...