Replicating Mover

Discussions about Coding and Scripting

Re: Replicating Mover

Postby Rakiayn » Fri May 18, 2012 2:37 pm

this is really interresting!
can you tell a little bit more about the mod you are building?
User avatar
Rakiayn
Masterful
 
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: Replicating Mover

Postby JackGriffin » Fri May 18, 2012 2:55 pm

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.
"You damn kids, back in my time we made the items, maps and games ourselves with an unwieldy engine using counter-intuitive crash-prone tools and we liked it so much we built communities around this which nowadays look like cults because they're quasi-parallel societies based on the same old games." -Hellkeeper
User avatar
JackGriffin
Godlike
 
Posts: 3715
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: Hack coder

Re: Replicating Mover

Postby TehDevil » Fri Aug 17, 2012 5:57 pm

So.. What ever happened to this mod?
TehDevil
Novice
 
Posts: 5
Joined: Fri Sep 17, 2010 3:18 pm

Re: Replicating Mover

Postby Dizzy » Thu Oct 11, 2018 9:21 pm

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
Image
Join our UT Discord chat server: https://www.bunnytrack.net/discord
User avatar
Dizzy
Experienced
 
Posts: 95
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

Previous

Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 3 guests