missionScreenEnded does not work in trunk 1.75.0.4324

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Svengali »

It all boils down to 'one button handling' like in RL. The coming Hyperradio uses

Code: Select all

this.activated = function()
{
	if(!this.lastPress) worldScripts.hyperradio.SelectHyperradioStation(1);
	else {
		if((clock.absoluteSeconds-this.lastPress)<2) worldScripts.hyperradio.SelectHyperradioStation(1);
		else worldScripts.hyperradio.startMusic();
	}
	this.lastPress = clock.absoluteSeconds;
}
Surely a combat scenario would need a more responsive solution, but for this piece it's well working.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Thargoid »

It will also depend on how many OXPs using the function you have. Both TCAT and Vortex will also have it (ECM Jammer and retractable turrets respectively), but I guess if the player has too much then simple usage (especially in pressure situations like combat) won't be easy.

That said there could be a silver lining of self-regulation in that. More equipment leading to less responsiveness...
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Thargoid »

Kaks wrote:
True, Ramirez temporary missiles/instruction icons seems the best option yet for battle situations, though that does make that equipment only available if the player has at least X missile pylons in total...
And it could become interesting if you don't have the multi-targetting system installed, or if it gets damaged :twisted:
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Ramirez »

Thargoid wrote:
Kaks wrote:
True, Ramirez temporary missiles/instruction icons seems the best option yet for battle situations, though that does make that equipment only available if the player has at least X missile pylons in total...
And it could become interesting if you don't have the multi-targetting system installed, or if it gets damaged :twisted:
Which is why I'm giving a lot of though to forcing the selection of the player ship or, at the least, carefully managing the equipment selection. 5 missile slots should be sufficient for what I'm trying to do.

Good point on the multi-targetting system though - if that gets damaged I'll need to do an autorepair, unless I decide to be really harsh and say that your comms equipment is out of action!
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Okti »

How about a code like this.

Code: Select all

this.activated = function()
{
	if(!this.keyTimer || !this.keyTimer.isRunning)
	{
		this.keyTimer = new Timer(this, this.doActions, 2);	
		this.keyCount = 1; 
	}
	else
	{
		this.keyCount +=1
		if (this.keyCount == 6)	
		{
			this.keyCount = 1;
		}
	}
	if (this.keyCount == 1)
	{
		player.commsMessage("\n\n\n\n\n\n\n\n\n\n\n\n Option1",6);
	}
	else if(this.keyCount == 2)
	{
		player.commsMessage("\n\n\n\n\n\n\n\n\n\n\n\n Option2",6);
	}
	else if(this.keyCount == 3)
	{
		player.commsMessage("\n\n\n\n\n\n\n\n\n\n\n\n Option3",6);
	}
	else if(this.keyCount == 4)
	{
		player.commsMessage("\n\n\n\n\n\n\n\n\n\n\n\n Option4",6);
	}
	else if(this.keyCount == 5)
	{
		player.commsMessage("\n\n\n\n\n\n\n\n\n\n\n\n Option5",6);
	}
}
this.doActions = function()
{
	if (this.keyCount == 1)
	{
		player.commsMessage("Option1 Selected",6);
	}
	else if(this.keyCount == 2)
	{
		player.commsMessage("Option2 Selected",6);
	}
	else if(this.keyCount == 3)
	{
		player.commsMessage("Option3 Selected",6);
	}
	else if(this.keyCount == 4)
	{
		player.commsMessage("Option4 Selected",6);
	}
	else if(this.keyCount == 5)
	{
		player.commsMessage("Option5 Selected",6);
	}
}
The timer and activated function can always be structured acccording to internal or mission variables to give different functionality for requirements.

Okti
My OXP's
And Latest Mission Coyote's Run
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Thargoid »

I'd use a switch rather than those sequential if statements for this.keyCount. Also you may want to stop or delete the timer somewhere. Plus things may get a little confusing if the item is activated multiple times in quick succession?
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Okti »

Thargoid wrote,
I'd use a switch rather than those sequential if statements for this.keyCount. Also you may want to stop or delete the timer somewhere. Plus things may get a little confusing if the item is activated multiple times in quick succession?
My intention was to hack activated event, which can be used in an endless combinations. The implementation is up to the programmer.

I have tried this one because of an OXP proposal made to me. If that one suits you, you can implement it instead of mission screens in flight. As an example to switch between cargo or missile bays in Vortex.OXP.

Just trying to find other ways :D
My OXP's
And Latest Mission Coyote's Run
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Thargoid »

Indeed it could :) I was resisting those two particular examples as I think that menu/list is very quickly going to get overloaded with good ideas, making it's practical usage limited in-game (especially during combat or other pressure situations).

So the only thing the Vortex has in that list is its turret retraction/reactivation function
User avatar
Okti
---- E L I T E ----
---- E L I T E ----
Posts: 700
Joined: Sun Sep 26, 2010 1:51 pm
Location: A GH shop, near witchpoint to Oresrati in Galaxy 8

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Okti »

I think we will need an event primed equipment changed and a property (read-write) for the equipment primed in 1.75.2 :D
My OXP's
And Latest Mission Coyote's Run
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Ramirez »

As the subject's come up I thought it would be worth explaining how the experimental, pylon-based command method works. In a rare case of proper planning, I drew up some flow diagrams to understand how I wanted the system to operate, before then working out how to combine scripts and AI to do the job.

It's easier to explain by way of a quick demo, available here.

Upon launch a squad of four Mambas will be spawned. The unit selector panel allows you to select units 1-4 individually, while the diamond selects all. Use Y, T and M to select the relevant icon. Once selected, the panel will switch to a series of commands; here the icons represent the following:

Back (return to the unit selector panel)
Advance (for the moment this turns your squad into pirates!)
Hold (actually uses nullAI)
Regroup (the default follow-the-leader setting)
Engage (attack your current target if one is selected)

Although I rather like the visual control panel and have now built a whole scenario around it, the actual script functions that command the ships could just as easily be triggered using the new cyclic primer thingy in 1.75. At the moment, all the hard work is done by a ship script that's attached to a pylon-mounted mine. The 1.75 function could trigger the same bits of script, with the slight advantage that everything is kept within the same worldscript.

You can see how you could use this system to keep drilling down into a whole range of commands. For example, in the Resistance OXP I'm thinking of, unit 1 is actually the player, and so it would be better to have some special commands under the unit 1 selector button (e.g. status, comms check etc) which could themselves have further options. This is eminently doable; you just tell the script or AI to point to a different function (indeed there are a few placeholders in the controlbutton.js script for this).

I haven't actually downloaded 1.75 yet so a lot of this is speculation; just thought I'd share what I'm up to.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: missionScreenEnded does not work in trunk 1.75.0.4324

Post by Kaks »

Okti wrote:
I think we will need an event primed equipment changed and a property (read-write) for the equipment primed in 1.75.2 :D
You can always assign & check a missionVariable in 1.75 ... :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Post Reply