Dog Scripts

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
mapnewbie

Dog Scripts

Post by mapnewbie »

I have the scripts for making dogs chase and attack, but I can't seem to get them to work in my map. Here's the script, any idea how to get this to work. When I add this to my existing script, the game crashes. Thanks


//------
// Dog Attack
//------

waitexec "anim/dog_inithandler.scr"

//======================================================================
AttackMain:

self setmotionanim dog_bite_leg

wait .1

//bite enemy
if ( self . enemy != $player )
self.enemy damage self 75 self (0 0 0) (0 0 0) (0 0 0) 1 9 0 0;
else
{
local . dir = $player . origin - self . origin;
self.enemy damage self 75 self (0 0 0) local . dir (0 0 0) 1 9 0 0;
}

self waittill flaggedanimdone

goto AttackMain
end

//------
// Dog Chase
//------

waitexec "anim/dog_inithandler.scr"

//======================================================================
ChaseMain:

//chase enemy
self setmotionanim dog_run
self waittill flaggedanimdone

goto ChaseMain
end
tstrait72
Second Lieutenant
Posts: 154
Joined: Tue Jun 04, 2002 1:25 am
Location: York, PA U.S.A.
Contact:

Post by tstrait72 »

thats not what u want to use. open the scr for the sample map 'm4|0' that came with the editor and look at how they did it. also open the map file and find the dogs in there to see what entity properties they were given. it may take a little time to figure it out...
Toby, or not Toby, that is the question...

Staff Member
MoH Design
User avatar
Gener_AL
Corporal
Posts: 41
Joined: Wed Jun 12, 2002 1:32 pm

Post by Gener_AL »

Okay this one had me a bit stumped for a while.....
all you need for dog_ai to work are info_pathnodes {paced between 256-512}appart if they are to far appart the dog will not chase...just bark... oh yeh and add the line "exec global/ai.scr" in your .scr
that should be it....oops i almost forgot dont play around to much with dogs properties...it just naffs up its ai for some inexplicable reason..

p.s. Nemesis if your reading i like your work but if you make another tut using my brainstuff{or anyone else`s}.....{it could be coincidence..} please give credit where its due......pls :D
HkySk8r187
Lance Corporal
Posts: 20
Joined: Fri Jun 28, 2002 6:37 pm
Contact:

Post by HkySk8r187 »

Gener_AL, I did what you said and it worked. The only thing is that one bite and you're dead. Any way to make the dogs attack take away less health? Thanks.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

dogs

Post by bdbodger »

when ever I kill a dog the game crashes I have lots of pathnodes and a sound fix and dogs work good but I can't kill them or game crashe with a server message past end error
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Whoa that's an old thread :shock:.

Maybe this is of any help:
http://modtheater.com/pafiledb.php?action=file&id=540
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

thanks jv but all I had to do was $dog1 exec anim/dog_inihandler.scr I didn't do that
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

ok ok you where right jv the dog died ok a couple of times then same thing so I downloaded the dog fix and all is ok again . Only thing is Vonderbakluft said to put his pk3 in main/maps that is not right it goes in main . I am going to redo my dog bot for mp to include this missing part . thanks .
Post Reply