Jump to content
james23222000

K9 Units script

Recommended Posts

Edit: Problem with script, see here

Hello to everyone,

I have noticed people in the forum asking if it is possible for a K9 (police dog) script to make the dog attack or make people surrender. I have been scrutinising the Armed Arrest script that Hoppah has in his LA mod and have deemed it possible.

So soon I will be starting the scripting for this. I will require some help, this will be:

  • 2 scripting assisters - Anyone who is competant in command scripting, emergency 4 editor and emergency 4 to aid the progress of the script
  • 1 person for general aid - Some one who can reply to forum posts when I am busy with the script. Job given to Bruce563

Benefits:

  • Will be mentioned in the Read me section of the script
  • Will recieve the script before anyone else does.

Watch this space for updates

Regards

James

Edited by james23222000
Link to comment
Share on other sites

Hello to everyone,

I have noticed people in the forum asking if it is possible for a K9 (police dog) script to make the dog attack or make people surrender. I have been scrutinising the Armed Arrest script that Hoppah has in his LA mod and have deemed it possible.

So soon I will be starting the scripting for this. I will require some help, this will be:

  • 2 scripting assisters - Anyone who is competant in command scripting, emergency 4 editor and emergency 4 to aid the progress of the script
  • 1 person for general aid - Some one who can reply to forum posts when I am busy with the script.

Benefits:

  • Will be mentioned in the Read me section of the script
  • Will recieve the script before anyone else does.

Watch this space for updates

Regards

James

I don't mind helping with the editor part, but I'not a very good scripter...

Link to comment
Share on other sites

Guest __Uknow__
Hello to everyone,

I have noticed people in the forum asking if it is possible for a K9 (police dog) script to make the dog attack or make people surrender. I have been scrutinising the Armed Arrest script that Hoppah has in his LA mod and have deemed it possible.

So soon I will be starting the scripting for this. I will require some help, this will be:

  • 2 scripting assisters - Anyone who is competant in command scripting, emergency 4 editor and emergency 4 to aid the progress of the script
  • 1 person for general aid - Some one who can reply to forum posts when I am busy with the script.

Benefits:

  • Will be mentioned in the Read me section of the script
  • Will recieve the script before anyone else does.

Watch this space for updates

Regards

James

Do you have any experience with scripting?

Do you know wich part to use?

Do you know how to edit the scripts?

I know what I'm talking about. The K9-Script is a real pain in the a**. You only need to change 1 line BUT there are none animations available for the dog to combine them with. Try to allow a police officer to link up with a dog and see what I mean

Link to comment
Share on other sites

Do you have any experience with scripting?

Do you know wich part to use?

Do you know how to edit the scripts?

I know what I'm talking about. The K9-Script is a real pain in the a**. You only need to change 1 line BUT there are none animations available for the dog to combine them with. Try to allow a police officer to link up with a dog and see what I mean

I do have experience with scripting, I know how to edit any scripts and which parts to use. I know about that but but I a mstill going to do it :)

Link to comment
Share on other sites

Guest Gabone

Hey ! Im working on a script me too for a K-9 Unit... but i have a problem lol i cant find my script in the edit ?! I'm stuck and i can't test the script. Anyone might give me a hint?

Link to comment
Share on other sites

My logfile tells me that the script only works upto childID 1. I have looked over and over agin for the problem but can't find anything. Does anyone have any ideas as to why it might not be working.

// Script created by james23222000
// DO NOT USE IN ANY OTHER MOD WITHOUT DIRECT PERMISSION FROM JAMES23222000

object SendK9 : CommandScript
{
SendK9()
{
SetValidTargets(ACTOR_PERSON);
SetPossibleCallers(ACTOR_PERSON);
SetPriority(500);
SetIcon("senddog");
SetCursor("arrest");
SetPossibleExists(CPE_NONIJURED_PERSON);
SetRestrictions(RESTRICT_NOTARRESTED | RESTRICT_NOTINJURED);
}

bool CheckPossible(GameObject *Caller)
{
if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;

return true;
}
bool CheckGroupVisibility(GameObject *Caller)
{
if(!Caller->IsValid() || Caller->GetType() != ACTOR_PERSON)
return false;
Person p(Caller);
return p.IsLinkedWithPerson();
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if(!Caller->IsValid())
return false;

if(!Target->IsValid() || Target->GetType() != ACTOR_PERSON)
return false;

Person p(Caller);
Person tp(Target);
Person t = p.GetArrested();

if(!p.IsValid() || !t.IsValid() || p.GetEnteredCarID() != -1)
return false;

if(p.GetID()== Target->GetID() || Target->GetID()== t.GetID())
return true;

if(!t.HasAnimation("bark"))
return false;

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{

if (childID == 0)
{
Person p(Caller);
Person tp(Target);
Person t = p.GetArrested();
Caller->PushActionTurnTo(ACTION_NEWLIST, Target);
Caller->PushActionRelease(ACTION_NEWLIST);
Caller->PushActionSwitchAnim(ACTION_APPEND,"senddog");
Caller->PushActionWait(ACTION_APPEND,2);
Caller->PushActionSwitchAnim(ACTION_APPEND,"Idle");
tp.PushActionTurnTo(ACTION_NEWLIST, &t);
System::Log("SendK9, childID == 0");
t.PushActionExecuteCommand(ACTION_APPEND, "SendK9", NULL, 1, false);
}

if (childID == 1) //Go to target
{
Person p(Caller);
Person tp(Target);
Person t = p.GetArrested();
t.PushActionMove(ACTION_NEWLIST, Target, TARGET_FOLLOW);
t.PushActionWait(ACTION_APPEND, 0.5f);
t.PushActionExecuteCommand(ACTION_APPEND, "SendK9", NULL, 2, false);
System::Log("SendK9, childID == 1");
}
if (childID == 2) //Dog Attack
{

Person p(Caller);
Person tp(Target);
Person t = p.GetArrested();
t.PushActionSwitchAnim(ACTION_APPEND, "attack");
t.PushActionWait(ACTION_APPEND, 3.0f);
tp.PushActionSwitchAnim(ACTION_APPEND, "fistfight01");
tp.PushActionWait(ACTION_APPEND, 1.5f);
t.PushActionExecuteCommand(ACTION_APPEND, "SendK9", NULL, 4, false);
tp.PushActionExecuteCommand(ACTION_APPEND, "SendK9", NULL, 3, false);
System::Log("SendK9, childID == 2");
}
if (childID == 3) //Injure Person
{
Person p(Caller);
Person tp(Target);
Person t = p.GetArrested();
tp.Injure(INJUREREASON_ENERGY, true);
System::Log("SendK9, childID == 3");
}
if (childID ==4) //Dog barks
{

Person p(Caller);
Person tp(Target);
Person t = p.GetArrested();
t.PushActionSwitchAnim(ACTION_APPEND, "idle");
t.PushActionWait(ACTION_APPEND, 1.5f);
t.PushActionSwitchAnim(ACTION_APPEND, "bark");
t.PushActionExecuteCommand(ACTION_APPEND, "SendK9", NULL, 5, false);
System::Log("SendK9, childID == 4");
}
if (childID == 5) //Rescue leader calls dog
{

Person p(Caller);
Person tp(Target);
Person t = p.GetArrested();
Caller->PushActionMove(ACTION_NEWLIST, Target, TARGET_FOLLOW);
Caller->PushActionCallDog(ACTION_NEWLIST, &t);
System::Log("SendK9, childID == 5");
}
}
};

Regards

James

Edited by james23222000
Link to comment
Share on other sites

Wow, Finally someone is working on this. I try to bring this up before and some keep saying it won't work.

But a few think it would work. I know it could since dogs can attack it game.

I would love to to use this Police Dog in Tokyo Mod also.

Will the dog able to search or follow?

Link to comment
Share on other sites

if I see it fast you dont give any value to ChildID so the default value is 0

No, that is the value I set it to.

The log tells me that both the ChildID == 0 and the ChildID == 1 parts of the scripts function properly

Regards

James

Link to comment
Share on other sites

Anyone??

I'm a very bad scripter so I only checked punctuation and such. That all seams fine to me. Did found this:

if(!p.IsValid() || !t.IsValid() || p.GetEnteredCarID() != -1)
return false;

I'm not sure if -1 is a valid value, but it's the only thing I could think of.

greetz,

Edited by pyrothijs
Link to comment
Share on other sites

I'm a very bad scripter so I only checked punctuation and such. That all seams fine to me. Did found this:

[cod]if(!p.IsValid() || !t.IsValid() || p.GetEnteredCarID() != -1)

return false;

I'm not sure if -1 is a valid value, but it's the only thing I could think of.

greetz,

That is valid. If it wasn't, the script wouldn't work at all, but thanks anyway :)

Still looking for help

Regards

James

Link to comment
Share on other sites

maybe you can better make at solo commands, like attack civillian, search wounded, stop civilian. then you can find the bug by value and not by the hole script

Thats how this script works. It only does part of the command at a time as if each childID is a single command script.

Still need help.

Regards

James

Link to comment
Share on other sites

Thats how this script works. It only does part of the command at a time as if each childID is a single command script.

Still need help.

Regards

James

you don't get the different

the different is:

childID: 1 command, and get more it CAN do

5 commands: the k9 dog will do the thing you want. and the player set what not the script/game/dog

Link to comment
Share on other sites

Have you try to do each command alone without any problems?

I know you have to create a script for each command... But it let you know if the command works.

Then slow add each command into one script...

I hope that solve your problem?

Link to comment
Share on other sites

as i said some weeks ago there is an animation for dog to attack people in rabid dog call. do you think you could use it?

I am using that, but there is a problem with the script that I haven't yet worked out. I am working on it though.

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...