Page 2 of 2

Re: Replicating Mover

Posted: Fri May 18, 2012 2:37 pm
by Rakiayn
this is really interresting!
can you tell a little bit more about the mod you are building?

Re: Replicating Mover

Posted: Fri May 18, 2012 2:55 pm
by JackGriffin
I thought this might interest people.

The OP was nice enough to let me peek at the mod and I must say that although I would do it a little differently (I think), his ideas have very real potential and I'm quite interested in how he does a release for this. It's worth staying tuned for.

Re: Replicating Mover

Posted: Fri Aug 17, 2012 5:57 pm
by TehDevil
So.. What ever happened to this mod?

Re: Replicating Mover

Posted: Thu Oct 11, 2018 9:21 pm
by Dizzy
comoestas wrote:Fully replicating mover code:

Code: Select all

class DynamicMover native;

var vector mDesiredLocation;
var rotator mDesiredRotation;
var float accLocX, accLocY, accLocZ, accRotYaw, accRotPitch, accRotRoll; // replicate without loosing accuracy

replication
{
	reliable if (Role == ROLE_Authority)
		accLocX, accLocY, accLocZ, accRotYaw, accRotPitch, accRotRoll;
}

native function SetBrush(model m);

event PostBeginPlay()
{
	mDesiredLocation = Location;
	mDesiredRotation = Rotation;
}

simulated function Tick(float DeltaTime)
{
	if(Role == ROLE_Authority)
	{
		accLocX = Location.X;
		accLocY = Location.Y;
		accLocZ = Location.Z;
		accRotYaw = Rotation.Yaw;
		accRotPitch = Rotation.Pitch;
		accRotRoll = Rotation.Roll;
	}
	else
	{
		mDesiredLocation.X = accLocX;
		mDesiredLocation.Y = accLocY;
		mDesiredLocation.Z = accLocZ;
		mDesiredRotation.Yaw = accRotYaw;
		mDesiredRotation.Pitch = accRotPitch;
		mDesiredRotation.Roll = accRotRoll;
	}

	if(Location != mDesiredLocation)
		SetLocation(mDesiredLocation);
	if(Rotation != mDesiredRotation)
		SetRotation(mDesiredRotation);
}

defaultproperties
{
	 bNoDelete=false
	 NetPriority=1.400000
	 MoverEncroachType=ME_IgnoreWhenEncroach
	 NumKeys=1
	 MoveTime=0.000000
	 StayOpenTime=0.000000
	 InitialState=""
}
This isn't working/compiling for me. I had to make it "extend Mover" instead of "native" and remove the "native function SetBrush" to get it to compile. Then when it's used in a map, it crashes when a player joins.

Has anyone got this to work? Why is it "native" anyway?

*Edit:* got it to compile using "ucc make -NoBind" but now I can't import it into the Editor:

Image