[Plugin] RNPC - Recordfree NPCs | Control NPCs without recording | DEV
#21

um cool but I better wait for Alex009 to rerelease CNPC ^^
Reply
#22

he wont continue his work
Reply
#23

Quote:
Originally Posted by Meta
View Post
um cool but I better wait for Alex009 to rerelease CNPC ^^
We still speaking about memory hacking which is against the rules. CNPC could be released somewhere else but not on this forums as far as i know. And the addresses could change on any SAMP release so that's the hard part.
Reply
#24

Quote:
Originally Posted by Babul
View Post
@Mauzen: <Removed: This is the English language section.>
<Removed: This is the English language section.>


@CNPC disucssion: CNPC is admittedly on an higher level than this. This plugin just makes use of the existing possibilities, while CNPC bypasses them and accesses the NPCs directly. The memory hacking was okay for the samp team, until it was used to fake the server player count. This shows that its easy to do illegal things as soon as you use memory hacking, thats why i dont wanna do it (and because i cant do it anyways )

@AIped: Im indeed not sure about this yet, but it might be possible. They can at least be put in cars using the normal samp functions. Syncing it nicely with animations would be the worst-case way to do it.


So, finished my work for today, time to continue with the plugin
Reply
#25

Quote:
Originally Posted by Mauzen
View Post
So, finished my work for today, time to continue with the plugin
The first feature i want to see is NPC in vehicles. (possible PutNPCInVehicle)
Reply
#26

Quote:
Originally Posted by TheArcher
View Post
The first feature i want to see is NPC in vehicles. (possible PutNPCInVehicle)
Working on this, but at first im gonna rewrite the generation code, else id have to rewrite it for both on-foot and vehicles afterwards
Reply
#27

Quote:
Originally Posted by Mauzen
View Post
Working on this, but at first im gonna rewrite the generation code, else id have to rewrite it for both on-foot and vehicles afterwards
Great news can't wait. I've already prepared everything for the release
Reply
#28

Quote:
Originally Posted by [HLF]Southclaw
View Post
Sweet Mother Of God

I can FINALLY get my zombie script back up and start coding some INTELLIGENCE

I love you, thank you for releasing this!
Hehe, youre welcome

Reporting back from my current progress: I just finished rewriting the generation code. The code looks a lot nicer now (probably its still a nightmare for real c++ coders) and is about 4 times faster than the old one (some numbers - bare include: 53 calls/s, old code: 255, new code 1050). Never tested the speed before, but I thought it would be faster at all, however its realistically useable now
With more optimisation the speed will probably go up a lot more.
So now I'll start adding vehicle support, and hope i can upload the next version today
Reply
#29

Hehe nice use of it.

Any NPC pros around? Maybe im just missing a stupid tiny thing.
I cant get my testnpc joining a vehicle, no matter what I try. PutPlayerInVehicle does nothing at all, neither in OnPlayerSpawn nor via a command. the npc remains unmoved, and OnNPCEnterVehicle is not called. Got to be some problem with the script. The npc script is almost unchanged since 0.1, the gamemode is an almost untouched lvdm.
Vehicle support is ready to be tested, but i cant test it that way.

Edit: The PutPlayerInVehicle even "bugs" the npc, afterwards he doesnt play back recordings at all and leaves the server. Seems like he would just enter the vehicle "a bit" so hes waiting for vehicle recordings, but is still on foot.

Edit2: He accepts vehicle recordings after PutPlayerInVehicle and plays them back. Hm I thought he would at least idle in the vehicle, no callbacks are called, IsPlayerInAnyVehicle is useless, so its really hard to determine if a npc is in "vehicle mode" or not.
Reply
#30

According with Southclaw, and i guess we had some ideas about our future plans and using the plugin, this could be a challenge , anyways i really needed PutPlayerInVehicle and IsPlayerInVehicle for NPCs, still waiting for future release.
Reply
#31

Perhaps setting the keys to the enter vehicle key would work.
Reply
#32

Version 0.2 is ready!
It offers TONS of new possibilities, but unfortunately still only for OnFoot NPCs. You can now control every NPCs attribute (weapon, keys, specialactions, blablub). I tried to develop a easy system for creating the npc recordings, and hope i succeeded with it. As there are tons of new functions im setting up a wiki page for RNPC right now.
The download package now also contains a test filterscript, that allows assembling scripts via commands. Check its source for all the commands.
Ill add the new download link to the first posts in a second.

Heres a video demonstrating some of the possbilities using the filterscript:
[ame]http://www.youtube.com/watch?v=1arZzO34_3k[/ame]


Testing the onfoot quaternions i found out you can rotate the bot in a funny way, but you cant use them for aiming.
For the vehicle support im seemingly still missing some recfile details, as I cant build working vehicle recs at this moment. (Even the include and plugin contains functions for vehicles they do not work, they are just for my own tests and im too lazy to remove them for the release ) Ill try my best to get it working soon.
Reply
#33

maybe its a stupid thought..maybe your missing it so did you actually used

public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE,"yournpc"); ?

if its not used the recording will obviously only be played once
Reply
#34

Quote:
Originally Posted by AIped
View Post
maybe its a stupid thought..maybe your missing it so did you actually used

public OnRecordingPlaybackEnd() StartRecordingPlayback(RECORDING_TYPE,"yournpc"); ?

if its not used the recording will obviously only be played once
Theres a function in the new version to toggle repeating

Edit: Heres the wiki page with all the infos and some example code: https://sampwiki.blast.hk/wiki/Rnpc
Reply
#35

Thought the same, the only things thats missing is just synced aiming, too bad that it seems impossible with rec files.
I like working on this so much that im not even using it for my own scripts these days. I was waiting for something like this for ages

(I like this code I wrote for the wiki page, so Ill jsut repost it here as its the best possible tutorial )
pawn Code:
RNPC_CreateBuild(npcid, PLAYER_RECORDING_ONFOOT); // start build mode
RNPC_SetWeaponID(32); // Set weapon
RNPC_AddPause(500); // wait a bit
RNPC_AddMovement(0.0, 0.0, 0.0, 20.0, 20.0, 0.0); // start moving
RNPC_ConcatMovement(0.0, 20.0, 0.0);  // Continue walking
RNPC_AddPause(200); // wait a bit again
RNPC_SetKeys(128); // aim straight forward
RNPC_AddPause(500);
RNPC_SetKeys(128 + 4); // Start shooting straight forward
RNPC_AddPause(500);
for (new i = 0; i < 360; i+=20) {
    // Makes the NPC rotate slowly
    RNPC_SetAngleQuats(0.0, i, 0.0);
    RNPC_AddPause(150);
}
RNPC_SetKeys(128); // stop shooting
RNPC_AddPause(500);
RNPC_SetKeys(0); // stop aiming
RNPC_FinishBuild(); // end the build mode and finish the build
 
RNPC_StartBuildPlayback(npcid);
Reply
#36

if the bullet hits you do you get damaged?
Reply
#37

Awesome update, going to try it soon.
Reply
#38

Quote:
Originally Posted by Kar
Посмотреть сообщение
if the bullet hits you do you get damaged?
Yep, bullets deal their damage. I think also OnPlayerTakeDamage should work, as NPCs are synced like any normal player.
Reply
#39

Great plugin keep it alive
Reply
#40

The video looks awesome!

Although I realized that the NPC is floating a little over the ground before actually beginning to walk - is this fixable? Maybe applying the animation before setting the movement?

Apart from that its really great, I hope you can do some car-stuff too.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)