Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4066606 - 01/20/15 03:31 PM Bunch of questions from beginner  
Joined: Jan 2015
Posts: 2
10tacle Offline
Junior Member
10tacle  Offline
Junior Member

Joined: Jan 2015
Posts: 2
Hi all,

I'm new to the Warthog scripting language. Playing around with the Warthog in Elite: Dangereous I'm currently messing around with the scipting language a bit.

While I do understand the syntax and the general coding principles, in my view the official documentation does not really provide an in depth aproach to fully get familiar with the scripting language.

First question: Are you guys aware of a "more detailed" documentation or any pool of generic information which is missing in the documentation? Or maybe some other guys scripting code where I could learn things which are not documented in the official documentation?

Second one: While I got it done to open up an executable with the system spawn command here's my question: Would it be possible to open up an mp3 as well? The way I got it done was to open up an external player and then add the mp3 to be played via that external files' command line. The problem, however, is that with the scripting language I'm only able to always open up the executable over and over. Any idea to circumvent that is welcome.

Third one: By starting my script I'd like to check the position of certain switches (background: switching to other layers, however, I'd like to check what the current position of the switch is). Don't seem to find any information about the fact of whether or not this kind of status is stored somewhere or can be read by any function. Thanks for pushing me into the right direction.

Thank you and regards.
10tacle

Inline advert (2nd and 3rd post)

#4066897 - 01/21/15 02:29 AM Re: Bunch of questions from beginner [Re: 10tacle]  
Joined: Jan 2015
Posts: 3
Flobert Offline
Junior Member
Flobert  Offline
Junior Member

Joined: Jan 2015
Posts: 3
Hi,

You can find status of buttons, so if its a question of whether that button is pressed or not, or the switch is in a certain position, then at least its easy.
I can't get it working if its done during initialization, but if I use a switch to check, it works fine.
Here I demonstrated with an example, I use the Engine Fuel Flow Right switch, when switched to NORM, it will 1 time try to see if the button LTB on the Trottle is pressed.

Quote:

include "target.tmh"

//program startup
int main()
{

if(Init(&EventHandle)) return 1; // declare the event handler, return on error

MapKey(&Throttle, EFRNORM, EXEC("GetStatus();"));
}


int GetStatus()
{
if ( Throttle[LTB]) printf( "\xaLTB is on" );
};

//event handler
int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);

//add event handling code here
}




Hope you can use it

Last edited by Flobert; 01/21/15 02:32 AM.
#4067201 - 01/21/15 07:06 PM Re: Bunch of questions from beginner [Re: 10tacle]  
Joined: Jan 2015
Posts: 2
10tacle Offline
Junior Member
10tacle  Offline
Junior Member

Joined: Jan 2015
Posts: 2
Hi Flobert,

thanks a lot. Yes, that's definitely helpful.

While that leads into the right direction I also cannot get it going during initialization yet.

Best,
10tacle


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Headphones
by RossUK. 04/24/24 03:48 PM
Skymaster down.
by Mr_Blastman. 04/24/24 03:28 PM
The Old Breed and the Costs of War
by wormfood. 04/24/24 01:39 PM
Actors portraying British Prime Ministers
by Tarnsman. 04/24/24 01:11 AM
Roy Cross is 100 Years Old
by F4UDash4. 04/23/24 11:22 AM
Actors portraying US Presidents
by PanzerMeyer. 04/19/24 12:19 PM
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0