Jump to content
The Dark Mod Forums
demagogue

Newbie DarkRadiant Questions

Recommended Posts

@STRUNK

Soooo....I looked into it, had the item (STAR) rotated, arranged for Z axis rotation and removed four of the stoppers:

rotator.jpg.6298166101a4f07dea6763fcd6786457.jpg

Result: Works like a charm.

I have to admit that I do not have much experience with the S/R editor, but I would have never thought it could be used for things like that in the first place.

I will try to incorporate this setup into one of my puzzles and will revert to you asap.

Many, many thanks for your prompt help!

Jack

 

Edited by JackFarmer

Share this post


Link to post
Share on other sites

@JackFarmer

I don't know if it should go back to the starting position at some point, but since the wait time on the trigger relay is set to 3.7, when it travels all the way back to Pos1, funny things happen when you keep pushing het button.

=====

 

Forget about the speed, made it a mover_elevator and the speed can be set. Replaced the WS2.map.

 

WS2.map

Edited by STRUNK
  • Like 1

Share this post


Link to post
Share on other sites

@STRUNK

Regarding the "rotator", I have created the following setup:

rotator_problem.jpg.7c7a0a0718cd6692ff61deebda68d9e4.jpg

A= Button

B = Trigger Relay

C = Star

D = Func_static

  • C and D have the same XY position.
  • D includes the spawnarg "bind_Star"

 

Test:

When pressing the button, sometimes D rotates according to the Star specs, but most of the time it does not move (or only moves a few degrees).

The crazy thing is, if I try this in WS1 with smaller fs_brushes (and even with entity "D"!), it works perfectly. The other problem is, that I do not get sound playing during the movement.

It would be great to have a default door mover with the property "invert_on_trigger--0/1". :(

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

@JackFarmer

Since I'm at it .. I made the slider setup with a atdm:target_set_frobable to take control of triggering, so the button can't be pushed while the slider is in motion. There is a lot of targeting going on so it might seem complicated, but it's rather simple ^^

Button push triggers the trigger sequencer. Trigger sequencer triggers the GoPos2 button. GoPos 2 button trigger she Slider (elevator) + the atdm:target_set_frobable (so the button is not frobabla anymore) + FrobOn1, a trigger relay, that delays a trigger for 1.1 seconds and then triggers the atdm:target_set_frobable again, to make the button frobabla again ... etc. : )

WS3.map

  • Like 1

Share this post


Link to post
Share on other sites

@JackFarmer

 

14 minutes ago, JackFarmer said:

 

Regarding the "rotator", I have created the following setup:

rotator_problem.jpg.7c7a0a0718cd6692ff61deebda68d9e4.jpg

A= Button

B = Trigger Relay

C = Star

D = Func_static

  • C and D have the same XY position.
  • D includes the spawnarg "bind_Star"

 

Test:

When pressing the button, sometimes D rotates according to the Star specs, but most of the time it does not move (or only moves a few degrees).

The crazy thing is, if I try this in WS1 with smaller fs_brushes (and even with entity "D"!), it works perfectly. The other problem is, that I do not get sound playing during the movement.

It would be great to have a default door mover with the property "invert_on_trigger--0/1". :(

 

 

 

 

 

 

This is very typical : D It seems TDM starts freaking out when too many things happen in the same place or something. I've had a lot of unlogical things happen, and then somhow, by placing things further apart it, it can be solved sometimes. So you might try moving the star further away from the scene ... Hope it works.

About the sound .. where should it come from, and did it work when tested in WS1?

Edited by STRUNK

Share this post


Link to post
Share on other sites

@STRUNK

I will move the star further away and will see what happens. :)

The sound should come from D or the Star (preferable would be D of course, as  the Star shall be located in a blue room.

I gave the Star a sound shader and the property s_waitfortrigger---1, but that does not work. It neither works on D.

Hm....

 

Share this post


Link to post
Share on other sites

@JackFarmer

Jack .. I just had an ingenius idea : A stack of doors !! See WS4. Only thing you have to do is put a button and a trigger_sequencer in the setup : )

Hope this idea works for your setup. Otherwise I'm willing to look at it if you upload your map : )

WS4.map

  • Like 1

Share this post


Link to post
Share on other sites

@STRUNK

Moving the Star entity inside the picture entity did the trick!

I will do a dmap of the section in question for your reference and have it uploaded. :)

  • Like 1

Share this post


Link to post
Share on other sites

@JackFarmer

 

Nice!!

I have been playing with the door stack, that has also audio. You could get the mechanism for the audio from here and I think it's a neat trick that could be used in for things in the future. The turning back feature on this woud be a lot of hassle with the s/r setup in WS1.

 

For all: in this WS5 map are all 3 mechanisms (for partial rotation and translation), so if you're curious you only have to download this one.

WS5.map

Edited by STRUNK
  • Thanks 1

Share this post


Link to post
Share on other sites

@JackFarmer

This doorstack can be used for the slidingmotion also, but then with a simpler setup : O Instead of the doors rotating I have them translating !! You can also have one door translating, and an other rotating. I see a lot of uses for movement here : )

WS6 has all the setups from WS5 also.

WS6.map

  • Like 1

Share this post


Link to post
Share on other sites

So, I have been learnig a bit about scripting today, and came up with a script to do the partial rotation of an entity eacht time it's triggerd.

void Rotate45()

{
    //Rotates func_mover "Star" 45 degrees. You can set rotation to 90 or -90 or whatever you wish
    $Star.time (2);                                  //Time the entity "Star" takes to rotate 45 degrees
    $Star.accelTime (1);                             //Acceleration time of the movement
    $Star.decelTime (1);	                     //Decelleration time of the movement
    $Star.rotateOnce( '0 0 45' );                    //Number of degrees of rotation on 1 axis
    sys.trigger($Sound);                             //Triggers speaker entity "Sound"
    $Button.setKey( "trigger_when_opened" , "0" );   //Disables the button "Button" to trigger anything
    sys.waitFor($Star);                              //Makes this script stop until the movement of Star has finished
    sys.trigger($Sound);                             //Triggers speaker entity "Sound"
    $Button.setKey( "trigger_when_opened" , "1" );   //Enables the button "Button" to trigger again
}

The sound while rotating is now controlled by targeting a speaker entity named "Sound" but  ...  there should be a better way, I think, but I can't get it to work.

Does anyone know how to get the following scriptEvent's to work?

scriptEvent void accelSound(string sound);

Sets the sound to be played when the mover accelerates.

scriptEvent void decelSound(string sound);

Sets the sound to be played when the mover decelerates.

scriptEvent void moveSound(string sound);

Sets the sound to be played when the moving.
Edited by STRUNK
  • Like 1

Share this post


Link to post
Share on other sites

Is there a way to "prevent" particles from "penetrating" through brushes? I do not know how to express this more accurately, please look at the picture below:

brushdriplets.thumb.jpg.f313ab5ed042e5f749f36bc1c5d544e6.jpg

This goes for several particles I am using (water falls, steam vents).

Share this post


Link to post
Share on other sites

@JackFarmer

 

I did encounter the same problem some times and have no solotion but a workaround with a transparent camera gui ^^ But I guess it shoud be possible to customise the particle fx, so it doesn't drip that far down, with the Particle Editor (in Entity menu).

Share this post


Link to post
Share on other sites

@JackFarmergrayman describes a method for stopping rain particles out of rain patches from going through sealing brushes. He does this by making sure the rain patch is in a different visleaf from the one that he wants to stay dry. The particles are coming from a patch and not a func_emitter in grayman's case, but it's maybe worth a try.

Otherwise it'd look like reducing the particle's lifespan would be the way to go. You can use reloaddecls in the console to reload particles ingame, or even make yourself a shortcut like: bind "p" reloadDecls. Pressing p would reload particles, entity defs, materials etc.

 

@STRUNKnice to see that you aren't shying away from scripts, I think all the various subsystems of TDM (script, S/R, entities, objective editor) really potentiate each other to make a sum greater than its parts. Btw, you can alternatively use sys.trigger($Sound); for triggering entities, no need to name player1 all the time.

The 3 commands you posted look like they're borked. No matter whether I put in a soundshader or a sound file name, it stays mute for me too. Maybe you'd like to create an account and post a bug report on bugs.thedarkmod.com?

Share this post


Link to post
Share on other sites

@Dragofer

I tried different strings also, but it just doesn't seem to work.

sys.trigger($Sound) should do the same, but I didn't think of that yet.

This mornig I decided to do the very short tutorial https://wiki.thedarkmod.com/index.php?title=A_Beginner's_Guide_to_Scripting

That's where I seen this:

// JoeBloggs: this script triggers a door to open and close in a test map

void FrobDoor()
{
	sys.print("\n\nYour script is running");
	$TestDoor.activate($player1);
}

And I had downloaded the files from the cutscene tutorial : https://wiki.thedarkmod.com/index.php?title=Cutscenes_Part_1:_Cameras

Playing around a bit with lights, and later motion I learned a lot today. Looking throug all the Script events there is so much that can be scripted : O

One thing is that if you make something work with triggers ans s/r, you can copy all that you need for the "mechanism" and all will work, but with a script you have to rename all entitys again. Say you have a script involving light1, mover1 and particle1 and want to have the same, but triggered difrently for light2, mover2 and particle2, you need to copie the script and change the entity names. OR is there a trick for that?

Edited by STRUNK

Share this post


Link to post
Share on other sites

Make things look extra dusty/hazy can be done with "sys.fadeTo" , I found out today : )

https://streamable.com/5ts5p

void FadeScreenToColorAlpha()
{
	//Fades total screen to a set color and alpha in a set time
        
        sys.fadeTo('0.5 0.4 0.3', 0.3, 0.5);
}

 

Edited by STRUNK

Share this post


Link to post
Share on other sites

@JackFarmerthere's a wiki page referring to reloadDecls here (capitalisation doesn't seem to matter). Note that it'd be DECLS in all capitals, there's not an I there.

Or you mean it doesn't reload particles?

Edited by Dragofer

Share this post


Link to post
Share on other sites
Quote

Say you have a script involving light1, mover1 and particle1 and want to have the same, but triggered difrently for light2, mover2 and particle2, you need to copie the script and change the entity names. OR is there a trick for that?

@STRUNK I've never tried it, so I can only try to experiment from here. It is possible to make scripts reusable and give them information like numbers or entity names. With my present level of scripting I'd do something like this:

void reusable_script(entity mover, entity speaker, entity button)

{

button.setFrobable(0);

mover.moveTo('100 0 0', 2);

sys.trigger(speaker);

sys.waitFor(mover);

button.setFrobable(1);

}

And call it like this:

thread reusable_script($mover1, $speaker1, $button1);

thread reusable_script($mover2, $speaker2, $button2);

thread reusable_script($mover3, $speaker3, $button3);

Not fully automated renumbering, but I guess it's easier to have all the variable parts within 1 bracket. Maybe a more knowledgeable scripter wants to step in?

Note that you're using in-script names like "mover", "speaker" and "button". The engine doesn't need to look them up from your ingame entities, so they don't need a $ sign.

Edited by Dragofer
  • Thanks 1

Share this post


Link to post
Share on other sites
40 minutes ago, Dragofer said:

@JackFarmerthere's a wiki page referring to reloadDecls here (capitalisation doesn't seem to matter). Note that it'd be DECLS in all capitals, there's not an I there.

Or you mean it doesn't reload particles?

Ah, it's reloadDecls.

Wow, using this ingame and switching between DR and DM is very useful. Thank you for your help.

Share this post


Link to post
Share on other sites
11 hours ago, Dragofer said:

And call it like this:


thread reusable_script($mover1, $speaker1, $button1);

thread reusable_script($mover2, $speaker2, $button2);

thread reusable_script($mover3, $speaker3, $button3);

Hmm, what do you mean by "call" here?

In the "atdm:target_callscriptfunction" I have to "call" a script, and when I put "thread reusable_script($mover1, $speaker1, $button1);" there, it doesn't work.

Can you explain how it should work?

Share this post


Link to post
Share on other sites

@STRUNK it's not quite done yet. Unfortunately at present there are only exceptional situations where you can provide a script called from ingame with additional parameters, that go in those brackets next to the name.

The one example I'm aware of is trigger_touch brushes, which can tell its called scripts which entities are inside its volume. I've used that in the past for a teleportation script, switching it on and off for one frame.

In this case my workaround would be to make a small script of each call, and update the call spawnarg on each call_scriptfunction entity when you duplicate each set.

void move_script1(){thread reusable_script($mover1, $speaker1, $button1);}
void move_script2(){thread reusable_script($mover2, $speaker2, $button2);}

Share this post


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...