SA-MP Forums

Go Back   SA-MP Forums > SA-MP > Screenshots and Videos

Reply
 
Thread Tools Display Modes
Old 07/05/2012, 03:02 AM   #1
Joe Staff
High-roller
 
Joe Staff's Avatar
 
Join Date: Aug 2007
Posts: 2,796
Reputation: 375
Default [Video] Pawn Scripted Controllable NPCs.

During a conversation HERE I had decided to finally finished my Pawn Scripted Controllable NPCs (PSNPC would be an appropriate acronym) script. There have been several conversations involving creating a script much like this, but apparently it was just too much of a daunting task (repetitive) or knowledgeable scripters just couldn't be arsed to do it.

Anyway, this script writes .REC files for the NPC to use. Without the restriction of having to actually manually create the .REC file for the NPC to follow, scripters can force an NPC to go to a specific location without teleporting and the transition will be impressively smooth.

Coming from the previously mentioned conversation, I finally managed to get the angles to come out appropriately and the walking to not involve any jitterness. The epiphany of fixing the angles came to me while I was on the toilet (use radians instead of degrees), and the jitterness was caused by the NPC's velocity being too quick for the animation. After some trial and error (my favorite) I figured that an appropriate speed is 0.0065 (for jogging) (It's still just slightly slower than CJ's jogging, but close enough)

Video:
[ame]http://www.youtube.com/watch?v=FH6vteZCOgM[/ame]

Things I noted during experimentation:
The NPC will become permanently stuck if forced to go to a location within 0.5 meters roughly. This is probably due to the formulas used to determine the NPCs path, can be fixed through either adjusting the formulas or simply teleporting the NPC to the location.
Despite having 0 Z velocity, the transition for Z heavy paths seems to be pretty smooth. There are generally 60 or more 'blocks' of code for each generated recording, so that doesn't entirely surprise me.
The NPC's behavior with physics seems to be client sided, so things look a lot better than they actually are.
__________________
Big bottom girls make this rockin' world go 'round.
Joe Staff is offline   Reply With Quote
Old 07/05/2012, 03:06 AM   #2
freddy smyth
High-roller
 
freddy smyth's Avatar
 
Join Date: Dec 2010
Location: Australia
Posts: 1,200
Reputation: 155
Default Re: [Video] Pawn Scripted Controllable NPCs.

Hey, it really looks great. Well done mate!
__________________
freddy smyth is offline   Reply With Quote
Old 07/05/2012, 03:15 AM   #3
Snipa
Banned
 
Join Date: May 2010
Posts: 865
Reputation: 115
Default Re: [Video] Pawn Scripted Controllable NPCs.

Fascinating.. very nice movement.. any example code?
Snipa is offline   Reply With Quote
Old 07/05/2012, 03:22 AM   #4
Joe Staff
High-roller
 
Joe Staff's Avatar
 
Join Date: Aug 2007
Posts: 2,796
Reputation: 375
Default Re: [Video] Pawn Scripted Controllable NPCs.

Quote:
Originally Posted by Snipa View Post
Fascinating.. very nice movement.. any example code?
Depending on demand, I'll focus on fixing any issues, then I'll release.
__________________
Big bottom girls make this rockin' world go 'round.
Joe Staff is offline   Reply With Quote
Old 07/05/2012, 04:58 AM   #5
CaHbKo
Huge Clucker
 
Join Date: Nov 2007
Posts: 447
Reputation: 41
Default Re: [Video] Pawn Scripted Controllable NPCs.

Lol toilet ftw.

Great job! Looking forward to seeing the release.
CaHbKo is offline   Reply With Quote
Old 07/05/2012, 05:27 AM   #6
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,270
Reputation: 1129
Default Re: [Video] Pawn Scripted Controllable NPCs.

This is gold.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.irresistiblegaming.com:7777

Lorenc_ is offline   Reply With Quote
Old 07/05/2012, 07:33 AM   #7
Aira
Banned
 
Join Date: Apr 2011
Location: Philippines
Posts: 483
Reputation: 28
Default Re: [Video] Pawn Scripted Controllable NPCs.

Kitten would love this
Aira is offline   Reply With Quote
Old 07/05/2012, 08:28 AM   #8
freddy smyth
High-roller
 
freddy smyth's Avatar
 
Join Date: Dec 2010
Location: Australia
Posts: 1,200
Reputation: 155
Default Re: [Video] Pawn Scripted Controllable NPCs.

Quote:
Originally Posted by Aira View Post
Kitten would love this
Would love to see some smooth NPC zombies. =D
__________________
freddy smyth is offline   Reply With Quote
Old 07/05/2012, 08:49 AM   #9
Hanger
Huge Clucker
 
Join Date: Apr 2012
Location: UK
Posts: 204
Reputation: 32
Default Re: [Video] Pawn Scripted Controllable NPCs.

He probably used SetPlayerVelocity etc...
__________________
Hanger is offline   Reply With Quote
Old 07/05/2012, 11:39 AM   #10
Henk_Moody
Little Clucker
 
Join Date: Oct 2011
Posts: 3
Reputation: 0
Default Re: [Video] Pawn Scripted Controllable NPCs.

This is not really a scrupt question but when you climb onto a building... Will the nocs fly or climb to it? And if your blbehind anbuilding and the noc is on the other side will they go through or walk around or climb it or w/e
Henk_Moody is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] Controllable NPC Lorenc_ Includes 101 02/06/2014 06:08 AM
[REQ] [FS] Scripted/un-scripted - AddStaticVehicleEx Jack_Leslie Help Archive 3 08/05/2011 08:16 AM
Help with Controllable NPC! Elchulo Help Archive 1 02/01/2011 08:06 PM
[Tutorial] [Video Tutorial] Learn Pawn with MisterMido Part I Miado_Hulk Tutorials 14 25/11/2010 07:49 PM


All times are GMT. The time now is 12:12 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.