v7 beta documentation in progress. v7 beta documentation may be incomplete or inaccurate.
v7 functions and features may be significantly different from previous ACS versions.
These instructions are not valid for current v6+ ACS!
Requires v7.02 primary root scripts, will not work with the v7 beta primary root scripts.
(No special "Root Tools Custom" script required for v7.02+)
Please note that the v7 Drag mod requires special menu settings and it is recommended that you stick with the Drag menu for that mod.
Setup
First, set the DisableMenu setting to TRUE at the top of your Root Settings script:
integer DisableMenu = TRUE;
Now the default ACS menu will not come up when the vehicle is touched. You should leave the ACS menu script inside the vehicle to process other things, as it is more than just a menu scrript.
If you want a custom menu, add your own menu script! Commands from the V7 Driver HUD & Gesture API Commands can be sent from your menu.
Below is a very basic example menu that displays some of the V7 Driver HUD & Gesture API Commands and sends them to the linkset if selected by the owner OR by a seated rider. Modify it for your own needs or write your own.
Note: you can launch the built in sub-menus for Camera, Position, and Controls from your own menu by using those commands.
// ACS v7.0 custom menu example
// This example menu shows how you can issue v7 HUD/Gesture API commands to control ACS from your own menu
// Disable the built-in ACS menu by setting DisableMenu to TRUE in your root settings
// See the http://kcp.wikidot.com/wiki:v7hudapi for the commands you can use
// This is a very basic example that shows the API commands as menu entries and simply sends them.
key User;
integer channel;
integer listen_id;
string MenuText = "Custom Menu";
// add the http://kcp.wikidot.com/wiki:v7hudapi commands here between the " ", up to 12 in the list dor a standard dialog menu. Last entry should not have a comma after it.
list Menu = [
"Lights",
"Key",
"Locking",
"Horn",
"Flight",
"Turbo",
"Camera",
"Position",
"Controls",
"Rev",
"Burnout"
];
default
{
state_entry()
{
//llSay(0, "Hello, Avatar!");
}
touch_start(integer total_number)
{
User = llDetectedKey(0);
if (User==llGetOwner()||User==llAvatarOnLinkSitTarget(LINK_THIS)) //owner or seated guests can access the menu
{
channel = ( -1 * (integer)("0x"+llGetSubString((string)llGetKey(),-5,-1)) );
listen_id = llListen(channel, "", User, "");
llDialog(User, MenuText,Menu, channel);
llSetTimerEvent(30);//timer to turn off listen
}
}
timer()
{
llListenRemove(listen_id); //turns off menu listener
llSetTimerEvent(0);
}
listen(integer channel, string name, key id, string choice)
{
llSetTimerEvent(30); //extends time before menu listen closes if a command comes through
llMessageLinked(LINK_SET,100,choice,id); //passes the selected API command to the other scripts
}
}
You will notice in the above example in the llMessageLinked(LINK_SET,100,choice,id); that the listener's key "id" is passed along with the link command. You could also have passed the original "User" key variable of the menu toucher instead. This is so when triggering another menu script like the ACS Position menu, that menu will know who it is supposed to display for.
Show different menu labels than the API commands
I can't give a full-on scripting tutorial, but for the example above, if you wanted to show different menu labels instead of the actual API commands, the listen section would look something like this:
listen(integer channel, string name, key id, string choice)
{
if (choice == "Fly") llMessageLinked(LINK_SET,100,"Flight",id);
else if (choice == "Honk") llMessageLinked(LINK_SET,100,"Horn",id);
else llMessageLinked(LINK_SET,100,choice,id);
}
In this case your menu label for flight mode whould be "Fly" in your menu list at the top, and when selected it would issue the "Flight" API command. And for the "Honk" menu label, would issue the "Horn" command. Anything else would be sent as-is.
Launch the normal ACS menu from your own
If you want to launch the entire standard ACS menu as an option from your own custom menu, then your menu needs to issue this particular API/Link Message command with the custom menu user's key (stored as User in the example menu above and the command below) as the link message uuid key so ACS knows who to open the llDialog() menu with:
llMessageLinked(LINK_THIS,200,"",User);
The ACS scripts intercept the blank link message on 200, then open the standard menu to the user uuid key passed as User in the above example.
[v7 Main]