Enity climb a ladder?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Vic Marrow
Colour Sergeant
Posts: 95
Joined: Wed Aug 20, 2003 2:31 pm

Enity climb a ladder?

Post by Vic Marrow »

Is it possible to make an enity climb a ladder. If so how would you script it?
Vic Marrow
Colour Sergeant
Posts: 95
Joined: Wed Aug 20, 2003 2:31 pm

Post by Vic Marrow »

I tried useing the animation "wallclimb_guy2_main" and this might work the only thing is the wallclimber.tik says the enity will climb a 10ft wall (160 units) but I need him to climb 260 units. So my guy makes it half way up, then jumps over and back down where he started.
Vic Marrow
Colour Sergeant
Posts: 95
Joined: Wed Aug 20, 2003 2:31 pm

Post by Vic Marrow »

Ok I did this

Code: Select all

climb_ladder:
self anim ladder_up_lefthand
self waittill animdone
self.orgin = (56 -136 139)
self anim ladder_up_righthand
self waittill animdone
self.orgin = (56 -136 158)
self anim ladder_up_lefthand
self waittill animdone
self.orgin = (56 -136 177)
self anim ladder_up_righthand
self waittill animdone
self.orgin = (56 -136 196)
self thread climb_ladder
end
And this makes the enity look like he's climbing and he keeps climbing and climbing. But is there a way to make the enity move up in Z direction?
I tried to change the Z orgin after each animation but he stays on the ground. The climbing thread sure looks good just like hes climbing. Just got to figure out how to make him move upwards.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Use anim_noclip instead.
Image
Vic Marrow
Colour Sergeant
Posts: 95
Joined: Wed Aug 20, 2003 2:31 pm

Post by Vic Marrow »

How would you incorprate anim_noclip into the script? Would it go before or after the animation or replace it? Thanks for your help jv_map!!!!
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Replace 'anim' with 'anim_noclip' 8-)
Image
Vic Marrow
Colour Sergeant
Posts: 95
Joined: Wed Aug 20, 2003 2:31 pm

Post by Vic Marrow »

Yes jv_map this worked. :D I have

Code: Select all

climb_ladder:

self anim_noclip ladder_up_lefthand
self waittill animdone


self anim_noclip ladder_up_righthand
self waittill animdone


self thread climb_ladder


end
The ai will climb up and up and up. He goes all the way to the top of the sky box!!!!!!! How would you get the ai to stop at a certain waypoint? I tried the self.orgin thing but the ai would only climb so high no matter how many orgin commands I put in. I need him to stop at Z400 and I gave commands all the way up to Z500 but he still stoped at about Z285. When I put in the line "self thread climb_ladder" at the end it looped the thread and he kept climbing to the top of the sky box. How could I control this thread?
Vic Marrow
Colour Sergeant
Posts: 95
Joined: Wed Aug 20, 2003 2:31 pm

Post by Vic Marrow »

I got it to work. The ai will climb the ladder on the side of the submarine conning tower, when he gets to the top he jumps over the edge right onto the deck of the conning tower and stands idle.(cool)
Here's my thread

Code: Select all


climb_ladder:

self anim_noclip ladder_up_lefthand
self waittill animdone

self anim_noclip ladder_up_righthand
self waittill animdone

self anim_noclip ladder_up_lefthand
self waittill animdone

self anim_noclip ladder_up_righthand
self waittill animdone

self anim_noclip ladder_up_lefthand
self waittill animdone

self anim_noclip ladder_up_righthand
self waittill animdone

self anim_noclip ladder_up_lefthand
self waittill animdone

self anim_noclip ladder_up_righthand
self waittill animdone

self anim_noclip ladder_up_lefthand
self waittill animdone

self anim_noclip ladder_up_righthand
self waittill animdone

self anim_noclip ladder_up_lefthand
self waittill animdone

self anim_noclip ladder_up_righthand
self waittill animdone

self anim_noclip ladder_up_lefthand
self waittill animdone

self turnto $path4
self anim_noclip jumpgate
self turnto $path4
self waittill animdone


wait 1
self anim idle

end
So yes an ai can climb a ladder. You must position the ai to the ladder, then keep adding

self anim_noclip ladder_up_lefthand
self waittill animdone

self anim_noclip ladder_up_righthand
self waittill animdone

The more you add the higher the ai will climb. (The .orgin was messing it up)
Thanks jv_map for the "anim_noclip" this command made it possible :D
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

My pleasure :wink:
Image
Post Reply