Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

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
Link to comment
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
Link to comment
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". :(

 

 

 

 

 

 

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

 

Link to comment
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
Link to comment
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
Link to comment
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?

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

Link to comment
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?

Link to comment
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);}
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.
      · 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
    • 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...