Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: MatthTheGeek on June 02, 2011, 05:10:00 am

Title: [Feature request] set-countermeasures sexp
Post by: MatthTheGeek on June 02, 2011, 05:10:00 am
Title says all. A sexp to replenish the CMs of a ship is all I need to perfect my fake respawn system in BP Multi. Given the existence of the set-primary-ammo and set-secondary-ammo, hopefully this shouldn't be too hard to implement (famous last words).
Title: Re: [Feature request] set-countermeasures sexp
Post by: Colonol Dekker on June 02, 2011, 08:20:35 am
Title says all. A sexp to replenish the CMs of a ship is all I need to perfect my fake respawn system in BP Multi. Given the existence of the set-primary-ammo and set-secondary-ammo, hopefully this shouldn't be too hard to implement (famous last words).


Is "Shift + End" still a factor in your system?
Title: Re: [Feature request] set-countermeasures sexp
Post by: MatthTheGeek on June 02, 2011, 08:22:28 am
Shift-End means you're bypassing the whole fake respawn system, and you die for real. It's based on the fact players and AI-controlled player ships don't really die.
Title: Re: [Feature request] set-countermeasures sexp
Post by: Colonol Dekker on June 02, 2011, 10:48:30 am
That was my point :D

So you're making a bot-match mission in effect? Ok, SHIFT+END won't work. So.......... what if i want to self-destruct?

Sorry to detract from a fine feature request by the way  ;7
Title: Re: [Feature request] set-countermeasures sexp
Post by: MatthTheGeek on June 02, 2011, 11:42:15 am
You can't. I could have tried to use a key-pressed sexp, but I'm pretty sure that won't work correctly in multi : you can't have the sexp check which player has pressed the keys - and I haven't tested, but chances are it will work only for the host, as usual.
Title: Re: [Feature request] set-countermeasures sexp
Post by: karajorma on June 03, 2011, 09:50:41 pm
Key-pressed will only work for the host. There's no easy way to fix this as it's only really possible to fix SEXPs that change things rather than those that simply check the status of something.

Nonetheless a set-countermeasures SEXP is probably ridiculously easy to code. When I'm not hungover, I'll take a look at it.
Title: Re: [Feature request] set-countermeasures sexp
Post by: Goober5000 on June 06, 2011, 11:17:48 pm
This should be coupled with a get-countermeasures sexp if one doesn't already exist.
Title: Re: [Feature request] set-countermeasures sexp
Post by: Dragon on June 07, 2011, 03:44:20 am
Indeed.
That could also be used in other places, for example in carrier rearming system I'm going to soon start working on.
Combining combat landings, a few SEXPs and a model adapted for this, it should be possible to make a beliveable combat rearming/refuelling system.
Title: Re: [Feature request] set-countermeasures sexp
Post by: karajorma on June 07, 2011, 04:25:21 am
This should be coupled with a get-countermeasures sexp if one doesn't already exist.

Already coded in. I just need to do some preliminary testing since I coded it on a packed Chinese train while being asked to keep score in my friends game of Gin Rummy :p
Title: Re: [Feature request] set-countermeasures sexp
Post by: karajorma on June 17, 2011, 01:13:28 am
:bump:

Committed and available in the latest nightlies.
Title: Re: [Feature request] set-countermeasures sexp
Post by: mjn.mixael on June 17, 2011, 01:47:07 am
 :yes: HOT!