PDA

View Full Version : Script Problem!


Dwail
04-04-12, 11:55 AM
Hi, guys!. I'm with another problem! :damn:

I'm trying to make an script for listen, when i push Toggle Battle Stations direct access, with Ui interface menu of TheDarkWright, the sound correct for each case. (on/off)

I'm created the next script file, /data/scripts/AI/Crew/Toggle_battle_stations.aix :

strategy Toggle_battle_stations(wp)
{
action
{
Wp:ExecuteCommand( "Toggle_battle_stations" );

if Wp:Isbattlestations() then
{
Wp:PlaySoundWithLipsync("ExecutiveOfficer\Normal\MC_CR_SO_01_A", 0)
}
else
{
Wp:PlaySoundWithLipsync("ExecutiveOfficer\Normal\MC_CR_SO_03", 0)
}
endif;
Wp:ScriptCompleted();
}
}

When I active this script the game cause me CTD, when I try to loading a mission. I don't understand what's wrong!. Please, can you help me?

Thanks in advance!.

Dwail
04-04-12, 12:50 PM
I know what's the problem!!. I'm trying to resolve!!.

Dwail
04-04-12, 05:57 PM
Bad news!. After long time I have not obtained anything with the script. I believe that need one line in a "crew_commands" file, similar to this:

Toggle_battle_stations x x x ( xxxxxxx = xxxxxxxx )

But I don't know the values to aplicate to "Toggle_battle_stations"

Anyone can help me?

Thanks in advance!.

Vanilla
04-05-12, 02:48 AM
It is quite simple thing to do, but the main problem is to force the game to actualy trigger the command, if it is not triggered... that's it. There are two things you have to do for this to work:
1. You have to create an new entry for Battlestations command in crew_commands.txt file for all the subs. Each of these files contains an explanation (at the end) on how to compose those entries, they are relatively simple.
The one you need will look something like:

Toggle_battle_stations 1 1 1 ( CR_CHIEF = Toggle_battle_staitions )

2. When you have a command in the crew_commands, then you need to create a script for the command: 'Toggle_battle_stations.aix'.
You can get an idea on what must be done by looking through the files in SDBSM mod.

As I sais, however, the main problem is that you must somehow force the game to actually call the comand. That's a whole different story.

Dwail
04-05-12, 08:26 AM
It is quite simple thing to do, but the main problem is to force the game to actualy trigger the command, if it is not triggered... that's it. There are two things you have to do for this to work:
1. You have to create an new entry for Battlestations command in crew_commands.txt file for all the subs. Each of these files contains an explanation (at the end) on how to compose those entries, they are relatively simple.
The one you need will look something like:

Toggle_battle_stations 1 1 1 ( CR_CHIEF = Toggle_battle_staitions )
2. When you have a command in the crew_commands, then you need to create a script for the command: 'Toggle_battle_stations.aix'.
You can get an idea on what must be done by looking through the files in SDBSM mod.

As I sais, however, the main problem is that you must somehow force the game to actually call the comand. That's a whole different story.


Thank You very much for your help!! I'll try it.