Jump to content
Michael Jones

How to add commands to the command group

Recommended Posts

I'm looking to add radio commands that the police officers can use (shots fired, etc) but i have no modding experience and no idea how to add them to the command group. I've alreafy got some of the clips from real police scanners i want to use.

Link to comment
Share on other sites

I'm sure a scripted here could tell you how to do it. By the sounds of it, all you'd need to get is a script that activated a sound file. Maybe look at the scripts that call units with a radio sound and remove only the bit that calls the actual unit.

These are just guesses!

Anyway, once you've got the script, add it to the unit via the editor.

Edit->Scene->Persons->(the police folder)->(your chosen unit)->Press on edit->edit commands->(find the command you want)->press the arrow facing left->Done! (I think)

Link to comment
Share on other sites

I've been fiddling around with the call patrol car script in LA mod version 2.1. I put a WAV file i have in and replaced the pd backup call that was there (overwrited it) with my file. I won't play the file in game and i can't figure out how to remove the backup from coming.

Link to comment
Share on other sites

I've been fiddling around with the call patrol car script in LA mod version 2.1. I put a WAV file i have in and replaced the pd backup call that was there (overwrited it) with my file. I won't play the file in game and i can't figure out how to remove the backup from coming.

 

Save the following as a new .script file, and add "PcmdShotsFired" to the person in the editor.

 

const char SND_PDBACKUP[]                = "mod:Audio/FX/radio/pd_backup.wav"; //rename if sound file differentconst char UNNAMED[]                     = "Unnamed";const char HINT_SHOTS[]                     = "Shots fired!";object PcmdShotsFired : CommandScript{PcmdShotsFired()    {SetIcon("callpatrolcar"); SetCursor("callassistance"); SetValidTargets(ACTOR_FLOOR | ACTOR_VIRTUAL); SetDeselectCaller(false); SetSelfClickActivation(true); SetHighlightingEnabled(false); SetGroupID(CGROUP_GETEQUIPMENT); SetGroupLeader(true);}    bool CheckPossible(GameObject *Caller)    {GameObjectList SelectPer = Game::GetSelectedGameObjects();        if (SelectPer.GetNumObjects() != 1) return false;        Person p(Caller);        if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false;        if (p.IsCurrentAction("EActionTreatPerson")) return false;        if (!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON) return false; return true;    }    bool CheckTarget(GameObject *Caller, Actor *Target, int childID)    {if(!Caller->IsValid() || Caller->GetID() == Target->GetID()) return false;        if (Caller->GetType() != ACTOR_PERSON) return false;        Person p(Caller);        if(p.IsValid() && (p.IsLinkedWithPerson() || p.IsCarryingPerson() || p.IsEquipped() || p.IsPulling() || p.GetFirehoseID()!=0 || p.GetEnteredCarID() != -1)) return false;        if (p.IsCurrentAction("EActionTreatPerson")) return false; return true;    }    void PushActions(GameObject *Caller, Actor *Target, int ChildID)    {Vector CmdPos = Game::GetCommandPos(); Caller->PushActionTurnTo(ACTION_NEWLIST, CmdPos); Caller->PushActionSwitchAnim(ACTION_APPEND, "talkmike"); Caller->PushActionWait(ACTION_APPEND, 3.5f); Caller->PushActionSwitchAnim(ACTION_APPEND, "idle");        if (1){Audio::PlaySample3D(SND_PDBACKUP, Caller->GetPosition()); Mission::PlayHint(HINT_SHOTS); return;}    }}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...