For direct access use https://forums.oldunreal.com
It's been quite a while since oldunreal had an overhaul, but we are moving to another server which require some updates and changes. The biggest change is the migration of our old reliable YaBB forum to phpBB. This system expects you to login with your username and old password known from YaBB.
If you experience any problems there is also the usual "password forgotten" function. Don't forget to clear your browser cache!
If you have any further concerns feel free to contact me: Smirftsch@oldunreal.com

Send Name From Player Code to Actor

The section related to UnrealScript and modding. This board is for coders to discuss and exchange experiences or ask questions.
User avatar
LannFyre
OldUnreal Member
Posts: 157
Joined: Fri Mar 13, 2015 7:01 am

Send Name From Player Code to Actor

Post by LannFyre »

I'm no longer using 3D model animations but instead textures via a whole setup.  I need to send a name to an actor, either 'stand', 'walk', or 'run' but I can't seem to send it through player code.  I've edited PlayerWalking and added an event tick(), but even then this function doesn't seem to be sending the name I need, even though I have added a call into my event.  Does anyone know why this would be, or how I could make a work around for this?

Code: Select all

state PlayerWalking
{
ignores SeePlayer, HearNoise, Bump;

      event tick(float deltaTime)
      {
            local name MyAnimGroup;

            bAnimTransition = false;
            
            if (Physics == PHYS_Walking)
            {
                  if ((Velocity.X * Velocity.X + Velocity.Y * Velocity.Y) < 1000) { MyAnimGroup = 'Stand'; }
                  else if (bIsWalking) {
                        if ( (MyAnimGroup != 'Walk')  ) { MyAnimGroup = 'Walk'; }
                  }
                  else {
                        if ( (MyAnimGroup != 'Run') ) { MyAnimGroup = 'Run'; }
                  }
            }
            else { PlayInAir(); }
            
            SActor.AnimGroup = MyAnimGroup;
      }
//========================
EDIT 6/8/17
//========================

So since I'm using an additional actor I'm think I might just copy this code into my existing sprite actors and just check the attach actor owner's current physics/speed and leave the player's origional code alone.  However I think I will get rid of their animation code and adapt it into the SpriteActor I have, actig as their external "animation".  But is there a better way to just get a name from my playerpawn and send it to my sprite actor?  This name will determine what sprites are pulled from a sprite library I pulled sprites into from an .int.

Also I need to clarify that I edited AnimEnd() in PlayerWalking and replaced it with this tick, which has most of the original code. Mind you, this method was still not working before I replaced the original code.
Also if I get this working, I'm gonna make a small new test level and upload it to youtube.  I'd like a still actor to display just standing sprites and not a walking set or running nor jumping sets.
Last edited by LannFyre on Sat Jul 08, 2017 1:19 pm, edited 1 time in total.
i tryin'a be a gud boi
User avatar
han
Global Moderator
Posts: 686
Joined: Wed Dec 10, 2014 12:38 am

Re: Send Name From Player Code to Actor

Post by han »

Tick() on PlayerPawns won't run just like you are used to it from other Actors [insert details here].

For Deus Ex they sort of hacked it around by putting stuff in PlayerTick() [insert other details here], but there was also some catch with it.

For HX I ended just adding some event TickStuff() and do the stuff there I wanted, but I should probably spent some time figuring out the specific details about Tick/PlayerTick...

HX on Mod DB. Revision on Steam. Löffels on Patreon.

Return to “UScript Board”