Jump to content
The Dark Mod Forums
demagogue

Newbie DarkRadiant Questions

Recommended Posts

1 hour ago, STRUNK said:

@JackFarmer

I mimicked a func_bobbing with the experimental func_mover_dragofer and it works if not set to interuptable: so the up or down movement always completes after shutting it off.

It's essentially what you could do with a sliding door, but with this func_mover you can set acc- decelleration time, so it looks like a func bobbing. It is triggerd by a trigger_timer, set to 0.1 sec longer then the move time of the func_mover, so it keeps bobbing when the trigger_timer is activated. Deactivate the trigger_timer and the bobbing stops.

https://streamable.com/7onrf

 

Bobbing.pk4 4.46 kB · 2 downloads

Thank you for that. However, I do not get the pk4 working (if I use the lever, nothing happens). You sure this is the same setup as in the video?

Edited by JackFarmer

Share this post


Link to post
Share on other sites

@JackFarmer

It should be the same. I reuploauded the file. Can you try it again? (Put the folder in the fms folder, open TDM > new mission > choose Bobbing > install missiion, then open the console and enter: testmap bob )

Is the blue thing a func_mover_dragofer?

Edited by STRUNK

Share this post


Link to post
Share on other sites

Hmm..the link above does not work any longer.

However, I did exactly as describe by you with the first file (though I had to add the .txt file with "Bobbing" as this was not included with your .pk4.

In game it looks like below:

 

https://streamable.com/gvv4o

 

 

 

Share this post


Link to post
Share on other sites

@STRUNK@JackFarmer @Dragofer

Just thinking about whether func_mover_dragofer  should be added (as an experimental/advanced method) to the  "Objects Floating On Water" wiki page. A drawback I see for the floating use case is that (looking at the video) the stoppage occurs at either of the 2 extremes, when what is desirable for floating is that stoppage always occurs at the midpoint of the range.

Share this post


Link to post
Share on other sites

My local copy of func_mover_dragofer, which I've renamed to func_mover_spawnargs, is quite far (500 lines and is designed for being used in complex mover-based puzzles) but still has issues arising from conflicts between my new interruptable sound system and the broken inbuilt sound system of the func_mover entity. Also, during stress testing I noticed an issue when the player frantically frobs multiple moving movers (movers move beyond their final positions), so at the moment only one mover is allowed to move at a time. 

I was thinking of just making a very simple sound system for now (snd_move and snd_stop) and finding a solution for the multi-mover problem, but my main PC broke down some weeks ago so I'm waiting for that to come back in any case.

Share this post


Link to post
Share on other sites

@Dragofer

I could live with a simple sound system, and for the stresstest, maybe there could be a limit on frob/trigger fequency, where only 1 frob in 1 or 2 seconds is taken as an actual trigger .. if possible ..

Share this post


Link to post
Share on other sites
1 minute ago, STRUNK said:

maybe there could be a limit on frob/trigger fequency, where only 1 frob in 1 or 2 seconds is taken as an actual trigger .. if possible ..

My implementation was to set a condition that the mover is stationary, otherwise the newly called script should terminate. There are a few ways I can think of to do that:

  1. Use existing functions isMoving and isRotating (plus check whether translation or rotate spawnargs, respectively, have been set)
  2. Create a new float and set it to 1 at the beginning of the script and 0 at the end of the script
  3. Disable the S/R response to frob and trigger at the beginning of the script, enable at the end of the script.

(Toggling frobbability would only disable frobbing but not triggering, so won't be enough)

Come to think of it, I'm not sure if I actually tried all 3 methods during stress-testing, I'll keep that in mind.

  • Like 1

Share this post


Link to post
Share on other sites

  

56 minutes ago, Geep said:

@STRUNK@JackFarmer @Dragofer

Just thinking about whether func_mover_dragofer  should be added (as an experimental/advanced method) to the  "Objects Floating On Water" wiki page.

func_mover_spawnargs isn't really designed for continuous movement, but rather for moving upon being triggered or frobbed. As STRUNK shows it can be used for bobbing regardless by automatically triggering it (move duration + 0.1) seconds. So it's a bit of an off-label use.

56 minutes ago, Geep said:

A drawback I see for the floating use case is that (looking at the video) the stoppage occurs at either of the 2 extremes, when what is desirable for floating is that stoppage always occurs at the midpoint of the range.

This is because it's only been set to use 2 positions. You could use 3 positions, but then there'd be 2 phases of acceleration & deceleration per cycle.

What you can do, however, is use a target_setkeyval entity to halve the "translate", "time" and maybe also accelTime and decelTime spawnargs, because the func_mover re-reads its movement spawnargs every time it's set in motion. At least that's the case in my local version of the entity (within my currently unusable HDD), and maybe also in the version I sent to STRUNK in our PMs.

 

Share this post


Link to post
Share on other sites

@Dragofer, not sure whether you are proposing that you use target_setkeyval  -

- repeatedly within the trigger_timer loop to keep halving the translate range until it reaches zero, or

- once when the object is at an extreme, to bring it back to the former-midpoint, but now the new end-of-range (but then you'd have to detect which extreme it's at first)

Share this post


Link to post
Share on other sites
27 minutes ago, Geep said:

@Dragofer, not sure whether you are proposing that you use target_setkeyval  -

- repeatedly within the trigger_timer loop to keep halving the translate range until it reaches zero, or

- once when the object is at an extreme, to bring it back to the former-midpoint, but now the new end-of-range (but then you'd have to detect which extreme it's at first)

It's option 2, but it doesn't matter when you do it. The next time the script is called it'll read the spawnargs and make them +/- depending on which direction it last moved.

That's for stopping it. If you want to get it to resume bobbing, you'll need to trigger it again to make it go back to its extreme. Then use a 2nd setkeyval to restore its original movement spawnargs, and restart the trigger_timer so it starts bobbing.

A trigger_sequencer could come useful for coordinating all of these triggers.

Share this post


Link to post
Share on other sites

I tried downloading the original bobbing.pk4, but couldn't then open it up as a zip. Oh well, not so important at the moment. @Dragofer, when it becomes stable, please send me a copy to play around with in the floating context.  I'm thinking, possibly it could be packaged up with the triggers as a on/off bobbing prefab?

Share this post


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

@JackFarmer

Nice!! Also thank @Dragofer for the scripting ;)

Do all your puzzles work now?

Correction, it works, but after activatiion DM crashes. Not always, but very often. I have tested the function on two machines with differing hardware configurations. :(

I found the problem: some related readable is causing the crashes.

Edited by JackFarmer

Share this post


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

@JackFarmer

Ok, that sucks. Could you send me the puzzle so I can try to fix this somehow?

Thanks, let me try some more changes. If I do not get it working, I will get back to you.

Share this post


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

@JackFarmer

Maybe replace the def and script files with the ones below, where I got rid off a lot of code  that you don't need.

custom_func.def 2.69 kB · 0 downloads tdm_reusable_script.script 2.07 kB · 0 downloads

I am afraid the crashing comes from the map's complexity as copying the relevant assets (map of_entities) to a test map shows that everything works as it should. :(

 

Edited by JackFarmer

Share this post


Link to post
Share on other sites

@JackFarmer

Ok, I'm working on a very simple script now and only have to know how many object jou want to have bobbing, and if I know how much they should translate, and in what direction, I can put that in the script already.

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