Hard Light Productions Forums

Modding, Mission Design, and Coding => The FRED Workshop => Topic started by: CommanderDJ on September 25, 2010, 11:31:11 am

Title: Switching targets
Post by: CommanderDJ on September 25, 2010, 11:31:11 am
Hey all, it's me again. I'm beginning to dominate this board with my request for help threads. Here's the situation:

I've got a jump node in a mission named "unknown jump node". At some point in the mission, the destination of the node becomes known and so the node is renamed. This is done by having another hidden jump node in the same place with the name, and at the point of renaming, the unknown one is hidden and the named one is shown. Fairly simple. However, if the player has the unknown node targeted when it is "renamed" then it is de-targeted (obviously, as it has disappeared). What I would like to happen is for the player's target to switch from the unknown node to the named one at the moment of renaming, but I can't seem to find a way to do it. AFAIK, the targeted SEXP only works for ships. How would I go about doing this?

Thanks,
CommanderDJ
Title: Re: Switching targets
Post by: General Battuta on September 25, 2010, 11:36:30 am
Hey all, it's me again. I'm beginning to dominate this board with my request for help threads. Here's the situation:

I've got a jump node in a mission named "unknown jump node". At some point in the mission, the destination of the node becomes known and so the node is renamed. This is done by having another hidden jump node in the same place with the name, and at the point of renaming, the unknown one is hidden and the named one is shown. Fairly simple. However, if the player has the unknown node targeted when it is "renamed" then it is de-targeted (obviously, as it has disappeared). What I would like to happen is for the player's target to switch from the unknown node to the named one at the moment of renaming, but I can't seem to find a way to do it. AFAIK, the targeted SEXP only works for ships. How would I go about doing this?

Thanks,
CommanderDJ

Can't you just use change-alt-name? No need for any of this business!
Title: Re: Switching targets
Post by: CommanderDJ on September 25, 2010, 08:46:57 pm
Bam. I literally learn something everyday on these forums.
Title: Re: Switching targets
Post by: The E on September 25, 2010, 08:52:12 pm
Here's a handy tip. In the Launcher's features section, under Dev Tools, mark the "Output SEXPs to sexps.html" checkbox. That way, you'll get an html file that'll contain all sexps the current build supports.
Title: Re: Switching targets
Post by: CommanderDJ on September 25, 2010, 09:01:24 pm
Here's a handy tip. In the Launcher's features section, under Dev Tools, mark the "Output SEXPs to sexps.html" checkbox. That way, you'll get an html file that'll contain all sexps the current build supports.

I will do that. Thank you

Can't you just use change-alt-name? No need for any of this business!

Unfortunately, I'm still having problems with this. I can only find ship-change-alt-name, which unsurprisingly only works for ships, at least as far as I can tell. Sadface. Is there an alternate method?
Title: Re: Switching targets
Post by: Trivial Psychic on September 25, 2010, 09:25:13 pm
He's right.  Ship-change-alt-name only works with objects, not jumpnodes.  Sounds like we need a new sexp... node-change-alt-name.
Title: Re: Switching targets
Post by: CommanderDJ on September 25, 2010, 09:43:47 pm
I will put in a SEXP request. In the meantime, I'll have to find a workaround.
Title: Re: Switching targets
Post by: FUBAR-BDHR on September 25, 2010, 10:47:04 pm
Could you use a Knossos instead of a jump node?  Since it's a ship the name change should work.
Title: Re: Switching targets
Post by: CommanderDJ on September 25, 2010, 10:57:36 pm
A Knossos wouldn't really be compatible with the storyline.

I think I'll just stick with the workaround I listed in my first post, and the player will just have to retarget the node. Unless someone has another suggestion.
Title: Re: Switching targets
Post by: General Battuta on September 25, 2010, 10:58:44 pm
Try using ship-change-alt-name in a when-argument, and have the name of the node be the only argument. See if that works.
Title: Re: Switching targets
Post by: Shivan Hunter on September 28, 2010, 03:01:56 pm
I don't think that'll work either as a jump node is not a hip ship, and possibly can't even support an alt name.

brb testing

[EDIT] Yeah, doesn't work. And um. Crazy typo in my FREDding haste