Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: HLD_Prophecy on August 25, 2016, 12:08:56 pm

Title: How to set up an automatic jump at a node
Post by: HLD_Prophecy on August 25, 2016, 12:08:56 pm
Hey all!

So I'd like to know how to set up an event so that the player automatically jumps when he reaches a certain node. The subspace drive is disabled otherwise.

I'm thinking "is-in-box", but doesn't that have to be tied to a subsystem? (Does a jump node have a subsystem? :P)

I mean, I suppose I could be un-lazy and make an AWOL debrief, but that would really mess up the immersion. And I'd still have to set it up so that the player could only "succeed" and continue to the next mission by jumping at the node.

This mod has a pretty unusual story, so plot and immersion reasons keep me from using many typical structures.
Title: Re: How to set up an automatic jump at a node
Post by: General Battuta on August 25, 2016, 01:36:54 pm
Do you want to allow the player to choose to jump, but only when inside the node?

Put a waypoint at the center of the node

When player is less than, uh, 100 meters (or whatever) from the waypoint, allow warp. Give this event 9999999 repeats with interval 0.

When player is greater than 99 meters (or whatever) from the waypoint, break warp. Give this event 9999999 repeats with interval 0.
Title: Re: How to set up an automatic jump at a node
Post by: procdrone on August 25, 2016, 02:04:58 pm
in mission submenu, you also have "force-jump" sexp that forces player ship to jump and end the mission (regardless of subsystem status, it will force the jump whatever the conditions are). It cannot be disengaged afterwards.

so you can do it like:

when
player distance <=100 ; waypoint
   -force-jump
Title: Re: How to set up an automatic jump at a node
Post by: Mito [PL] on August 25, 2016, 03:14:57 pm
Or you just go with red-alert - if the campaign requires it.
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on August 25, 2016, 07:50:37 pm
Do you want to allow the player to choose to jump, but only when inside the node?

Put a waypoint at the center of the node

When player is less than, uh, 100 meters (or whatever) from the waypoint, allow warp. Give this event 9999999 repeats with interval 0.

When player is greater than 99 meters (or whatever) from the waypoint, break warp. Give this event 9999999 repeats with interval 0.

I'd like to do it this way. Thanks guys for your help!

Hey, crazy add-on question - is there any chance I could get the words "JUMP NOW" or something like that to fade in (as a subtitle, you know) whenever the player is in that <100 meters (or whatever) distance? And fade out if the player leaves it again?
Title: Re: How to set up an automatic jump at a node
Post by: niffiwan on August 25, 2016, 09:47:57 pm
show-subtitle-text or show-subtitle-image? Both seem to have fade in/out options. (disclaimer, I have not personally used these sexps!)
Title: Re: How to set up an automatic jump at a node
Post by: procdrone on August 26, 2016, 10:13:51 am

I guess like this?

(https://i.gyazo.com/e01aa8ef3410788773e69eea0b7061f2.png)
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on August 27, 2016, 11:49:35 am
Whoa, thanks Hound! That's exactly what I wanted! Will set it up now.
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on August 27, 2016, 12:20:36 pm
Um, how do you get the text to stay there until/unless you leave the node again? As I have it, the text just fades out like normal.
Title: Re: How to set up an automatic jump at a node
Post by: procdrone on August 27, 2016, 02:02:11 pm
You could increase the timer on the text SEXP, but thats the not so good workaround.

I am not sure, the thing that I've shown in the video is exactly what you have on the screenshot. Im not sure how long it lasts... ill check later for that.
Title: Re: How to set up an automatic jump at a node
Post by: General Battuta on August 27, 2016, 02:04:54 pm
Set the fadein time to 0 and the fadeout time to 1 second.

Make the event that puts the text on screen repeat every second. Have it fire only if the player is within jump range of the waypoint.
Title: Re: How to set up an automatic jump at a node
Post by: procdrone on August 27, 2016, 03:53:17 pm
Set the fadein time to 0 and the fadeout time to 1 second.

Make the event that puts the text on screen repeat every second. Have it fire only if the player is within jump range of the waypoint.


That would be the way to do it I believe.
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on August 30, 2016, 04:57:36 pm
Set the fadein time to 0 and the fadeout time to 1 second.

Make the event that puts the text on screen repeat every second. Have it fire only if the player is within jump range of the waypoint.

So I can't have a fade in?

Sorry that I didn't respond for a while, I've been sick.
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on September 02, 2016, 01:53:17 pm
I can't figure out how to get it to repeat every second. And the fadein time and the fadeout time are controlled by a single number; they have to be the same.

I'm sorry, I'm just confused.
Title: Re: How to set up an automatic jump at a node
Post by: General Battuta on September 02, 2016, 02:29:48 pm
Use the repeat count to the right of the event list in the events editor.
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on September 06, 2016, 10:05:52 am
Use the repeat count to the right of the event list in the events editor.

Okay thanks, I found it! Sorry for not looking harder.

And how do I put "once every second" in there? It's just a number - what does the number mean?
Title: Re: How to set up an automatic jump at a node
Post by: AdmiralRalwood on September 06, 2016, 03:51:20 pm
Repeat count and interval are separate boxes, and the latter is specified in seconds (with "0" meaning "every frame").
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on September 12, 2016, 09:00:28 am
Okay... so I have Trigger Count for the show subtitle text event set to 0 so that it will there will be no delay between tests of the event - is this right?

Really I'm confused as to the difference between Repeat Count, Trigger Count, and Interval Time. Can someone explain this to me?

Alos Interval Time is grayed out for this event, for some reason. Not sure why I can't edit it, it's locked at 1.


Not sure if it makes any difference, but my show subtitle text event is separate from the allow-warp event. The show subtitle text event is reliant on the allow-warp event being true.
Title: Re: How to set up an automatic jump at a node
Post by: General Battuta on September 12, 2016, 10:15:21 am
No.

Trigger count says 'how many times can this event fire, assuming its conditions are true?'

Interval time says 'after the event fires, how long should I wait until I check to see if I can fire again?'

Just forget repeat count for now.

If your trigger count is set to zero the event will never happen. You need to set the interval count to zero to check every frame.

Never use trigger count with a chained event, afaik it gets weird.
Title: Re: How to set up an automatic jump at a node
Post by: mjn.mixael on September 12, 2016, 11:42:53 am
Never use trigger count with a chained event, afaik it gets weird.

All the big kids use Trigger Count, Repeat Count, and Chained Events for true chaos.  :nod:
Title: Re: How to set up an automatic jump at a node
Post by: AdmiralRalwood on September 12, 2016, 01:48:17 pm
Never use trigger count with a chained event, afaik it gets weird.
Or just set "$Use Alternate Chaining Behavior:" (http://hard-light.net/wiki/index.php/Game_settings.tbl#.24Use_Alternate_Chaining_Behavior:) in your mod's game_settings.tbl.
Title: Re: How to set up an automatic jump at a node
Post by: HLD_Prophecy on September 17, 2016, 03:46:20 pm
Oh, I think I get it!

So now I've got my trigger count set to 9999, will go test...


EDIT: Great Colossi on a stick! It worked! I went in and it the text stayed there, went out and it went away, went in went out went in went out... sorry.

Thanks a whole bunch, everyone, for being really patient and helping me get this figured out! Now I can get on with FREDing without worrying about that problem.  :)