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

Quote:
Originally Posted by Reynolds
View Post
Hey, Mauzen! Do you know how I could make the vehicles a bit less jiggery when following node paths? I wrote a script which makes an NPC recording from the NPC's current pos to a pos in LV (using GamerZ's Plugin) and it works really well, however, I have problems with the car movement. It is not as smooth as I would like it to be and I often find the car stuck in the ground when I am going from node to node. I would suppose this is due to the altitude differences and because a smooth interpolation does not exist yet.

How could I possibly make the experience a bit smoother?
In addition to just using the heights from the zmap, it would help to also interpolate the angles of the surface with them and rotate the vehicle like that. I dont think this can be done yet without modifying the rnpc or fcnpc plugin manually.
Beside from that I dont really know any better solution so far.

Quote:
Originally Posted by Kar
View Post
Give us this way "RNPC_SetKeys_RT(4, npcid, EDIT_MODE_OR);" but don't keep that _RT extension, lol.
Id love to do it that way, but how to differentiate between the RNPC_SetKeys to update the NPC in realtime, and the RNPC_SetKeys that should just affect future builds of the NPC. It would need at least one additional parameter then, and I dont like functions with that many parameters, its purpose would be much easier to see when there was an own function for the realtime updates.
But Ill think about that again, maybe Ill find a good solution.
Reply

I made something which kind of does that. Now I am only having issues with high slopes (such as highway turnoffs). I am thinking of setting the car's quats to the atan of x and y differences so that the car would be on the correct "slope", if that makes sense.

The only problem now is that I can't make the car stick to the right side of the road. Basic trig would solve that, providing there were a function in RNPC which could tell me the car's Z position at a specific stage of the recording. I would suppose this is not possible, but it would certainly be very cool.
Reply

Quote:
Originally Posted by Reynolds
View Post
I made something which kind of does that. Now I am only having issues with high slopes (such as highway turnoffs). I am thinking of setting the car's quats to the atan of x and y differences so that the car would be on the correct "slope", if that makes sense. I am still experimenting with that.

The only problem now is that I can't make the car stick to the right side of the road. Basic trig would solve that, providing there were a function in RNPC which could tell me the car's Z position at a specific stage of the recording. I would suppose this is not possible, but it would certainly be very cool.
Youre lucky, the next update will offer much more possibilities to interact with the recordings, like editing them in realtime, and also including getting any data at a certain time But right now theres absolutely no way to get that unfortunately.
Needs some major changes in the rnpc mechanics, thats why it takes that long.
Reply

I'm feelin' lucky! That update would solve many problems I've been having with real-time NPC plugins. Will it be possible to change the NPC's angular velocity in the future to improve vehicle turns? (The current script I wrote makes cars turn at right angles without any tire screeching and proper turning).

Also, could you confirm that SetAngleQuats doesn't work properly with AddMovement? It seems that no matter what value I set, I can't make the car roll over or set its pitch to a specific value.
Reply

Quote:
Originally Posted by Reynolds
View Post
I'm feelin' lucky! That update would solve many problems I've been having with real-time NPC plugins. Will it be possible to change the NPC's angular velocity in the future to improve vehicle turns? (The current script I wrote makes cars turn at right angles without any tire screeching and proper turning).

Also, could you confirm that SetAngleQuats doesn't work properly with AddMovement? It seems that no matter what value I set, I can't make the car roll over or set its pitch to a specific value.
Oops indeed, the plugin only considers the the z rotation for movements yet, and sets the others to 0. Very stupid bug, Ill also fix that.
Reply

Alright, thanks for the confirmation. I am looking forward to the next release even more.

Regarding this bug:
I was writing a code which would have (at least in theory) solved the issue with cars lagging into the ground if the terrain changes suddenly. Obviosuly, the main issue is that AddMovement does not set the car's proper rotation data (as far as I can tell, this is not a bug, as merely setting the pos of the NPC is the intended usage of this function) and it appears that the car "lags" into the ground whenever there is a big terrain change because the car's rotation never changes.

I was writing a fix which would have solved this issue by simply calculating the slope between the two nodes and setting the vehicle's pitch accordingly (basic trig, converting it into SAMP trig was the main issue). This would have made up for the lack of default rotation and would have caused nicer movement, but it didn't work at all, now I know why.
Reply

I dont know why but this plugin is not working for me.. does not create bots. I try on r1 , r2-2, r3 linux and windows.. Help me.
Reply

Quote:
Originally Posted by KoZaKo
View Post
I dont know why but this plugin is not working for me.. does not create bots. I try on r1 , r2-2, r3 linux and windows.. Help me.
You need to set the maxnpc value in the server.cfg. By default it is 0 and no NPCs will be able to connect.
Reply

Quote:
Originally Posted by Mauzen
View Post
You need to set the maxnpc value in the server.cfg. By default it is 0 and no NPCs will be able to connect.
I know about this. But still not connect/crate. I have VPS - Debian.


//tested on windows - same problem. maybe recompile plugin or something ? i try everything
Reply

@Mauzen theoretical question if i may.

How hard would it be to record npc in vehicle making 90% turn and then reuse that recording with offset's? (If his starting coordinate was 10, 10, 10 we move it to a new coordinates and its playing 10+offset, 10+offset, 10+offset)?

Im just desperate for decent vehicle movement system...
Reply

Edit:// nvm...just found the problem
Reply

Quote:
Originally Posted by DRIFT_HUNTER
Посмотреть сообщение
@Mauzen theoretical question if i may.

How hard would it be to record npc in vehicle making 90% turn and then reuse that recording with offset's? (If his starting coordinate was 10, 10, 10 we move it to a new coordinates and its playing 10+offset, 10+offset, 10+offset)?

Im just desperate for decent vehicle movement system...
Ive got a dev branch laying around with an "edit mode" in addition to the current "creation mode" that would allow relocation. Its not yet ready though. But even when relocating vehicle turns there are many things to consider, as terrain isnt flat everywhere, and vehicles dont always move with the same speed (though speed could also be adjusted in recordings)
Vehicle movements still are and probably always will be a problematic thing to do. Without having direct access to the GTA engine it can only be approximated, and it is difficult to approximate this fast enough and exact enough. But youre right, recording and moving is probably the best way to achieve a good result.
Reply

This plugin do't works with PathFinder due to the MapAndreas issues. Can you update(@Mauzen) the MapAndreas compatible to that of PathFinder?

I did comment the MapAndreas natives of RNPC but no NPC is connected then.
Reply

I can update RNPC for MapAndreas class integration. I will release special version.
Reply

I'm getting problems with ZCMD when I add RNPC include, so I have to add OnPlayerCommandReceived to fix it.
Reply

Quote:
Originally Posted by EnzoMetlc
Посмотреть сообщение
I'm getting problems with ZCMD when I add RNPC include, so I have to add OnPlayerCommandReceived to fix it.
pawn Код:
#include <a_samp>
#include <rnpc>
#include <zcmd>
Reply

Quote:
Originally Posted by EnzoMetlc
Посмотреть сообщение
I'm getting problems with ZCMD when I add RNPC include, so I have to add OnPlayerCommandReceived to fix it.
I added a fix for it that checks if zcmd is used, but its not working properly unfortunately.

Quote:
Originally Posted by pamdex
Посмотреть сообщение
I can update RNPC for MapAndreas class integration. I will release special version.
I already tried that, but it needs some adjustments, else it crashes the server on exit, as mapandreas is unloaded twice, and theres no check for that (double dealloc). So this also needs some changes to MapAndreas itself, or at least RNPC's mapandreas need to be changed to disable the unload on exit.
Best would be to create one version that supports both a linked mapandreas, and integrated mapandreas for those who dont need the mapandreas plugin itself (though thats probably the minority of users). But I didnt come up with a version good enough for release yet.
Reply

Mauzen, have you been able to repair the bug that crash to create more than 59 NPCs (supposedly is around that number up) ?, that is, if 50 is placed all is perfect, but if you put more than 60, due to as pause and return to the game (or at least that happens to me) most times crashea the game is rare that you do not crashea. Well, that's all, greetings and good luck.
Reply

Quote:
Originally Posted by LatinZ
Посмотреть сообщение
Mauzen, have you been able to repair the bug that crash to create more than 59 NPCs (supposedly is around that number up) ?, that is, if 50 is placed all is perfect, but if you put more than 60, due to as pause and return to the game (or at least that happens to me) most times crashea the game is rare that you do not crashea. Well, that's all, greetings and good luck.
I can spawn up to 100 NPC's on my script without anything happening the only issue I get is when I put more than 150 NPC the server starts sending the message "Blocking 127.0.0.1 due to a 'server full' attack (1)" and the gamemode gets knocked off and starts using the default gm only the cars spawn and the maps...
Reply

The plugin works for the 0.3.7 R2 ? Or only for the 0.3.7 ?
Moreover if it's not that my server crash when I use RNPC functions : the bot connect perfectly but when I'm in its range he should follow me but instead the server crash.

Код HTML:
forward RFollowPlayer(npcid);
public RFollowPlayer(npcid)
{
	new Float:zx, Float:zy, Float:zz,Float:x, Float:y, Float:z;
	for(new i = 0 ;i<MAX_PLAYERS;i++)
	{
	    if(!IsPlayerNPC(i))
	    {
			if (IsPlayerConnected(i))
			{
				GetPlayerPos(npcid, zx, zy, zz);
				if(IsPlayerInRangeOfPoint(i,RangeZ[i],zx,zy,zz))
				{
					GetPlayerPos(i,x,y,z);
					RNPC_SetUDKeys(KEY_UP);
					MoveRNPC(npcid,x,y,z,RNPC_SPEED_RUN,1);
				}
				else
				{
				    Range[i] = 20;
				}
			}
		}
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 8 Guest(s)