Orbiter-Forum  

Go Back   Orbiter-Forum > Projects > ORBITER: 2010-P1 and newer > Feedback
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

DG AAP script rewrite Issue Tools
issueid=1007 11-13-2012 04:06 PM
Ghost
DG AAP script rewrite

I've patched a couple of issues in DeltaGlider AAP, in case Martin would be interested.

What's fixed:
- correctly handles multiple vessels creation via Scenario editor
- destroys script interpreter upon AAP removal
- returns ailerons to zero position when bank/hdg aap is disabled

Code:
AAP.cpp:

Code:
AAP::AAP (DeltaGlider *vessel): DGPanelElement (vessel)
{
	int i;
	hAAP = oapiCreateInterpreter();
	hsi = NULL;
	oapiExecScriptCmd (hAAP, "run('dg/aap')"); // load the autopilot code
	
	char setVesselCmd[256];
	sprintf_s(setVesselCmd,256,"setvessel('%s')",vessel->GetName());
	oapiAsyncScriptCmd (hAAP, setVesselCmd); // set autopilot vessel

	active_block = -1;
	for (i = 0; i < 3; i++) {
		tgt[i] = 0;
		active[i] = pactive[i] = false;
	}
	scanmode = scanpmode = 0;
}

// ==============================================================
AAP::~AAP()
{
	oapiDelInterpreter(hAAP);
}
aap.lua: see pastebin: http://pastebin.com/wb3YmjBS
Issue Details
Issue Type Feedback
Project ORBITER: 2010-P1 and newer
Status Closed
Priority 10 - Lowest
Regarding Version 121025
Regarding Version (none)
Users who agree 0
Users who disagree 0
Assigned Users (none)
Tags (none)

11-13-2012 05:12 PM
Orbiter Founder
 
Thanks! I'll put that in the next beta.
Reply
Reply

Issue Tools
Subscribe to this issue

All times are GMT. The time now is 09:39 AM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.