Announcement

Collapse
No announcement yet.

Switching Pawns

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Switching Pawns

    Hey guys I'm currently creating a total conversion and could use with some help. I'm trying to implement character switching into my mod and wondered if any of you guys could help me. (By character switching I mean I want to change to a pawn that is already spawned and keep the old pawn I used to be controlling).

    Thanks.

    #2
    In case nobody can give you better help (well, I hope you get some), you could perhaps have a look at the code for this mutator:
    http://www.jeffwofford.com/boteviction.html

    Not sure if it is exactly the same "switching" that the one you are looking for but there is a chance it could help.

    Comment


      #3
      hmm thanks but I'm afraid looking at that code didn't really offer any insight. What I'm really looking for it a way of replacing a monster's controller (or possibly another pawn's controller) with the current controller to give the illusion of changing characters. Once I've possessed the monster I'll need to create a controller for the old pawn (probably a monster controller).

      Comment


        #4
        You can use LinkMesh() to swap the meshes and LinkSkelAnim() to swap animation files. Controllers have the Possess() and Unpossess() functions that may be helpful.

        Comment


          #5
          Thanks for the replies. I'm afraid I don't know alot about unreal script to be honest so have no idea how I'd change from the pawn the controller currently uses to one already spawned in the game. Clearly I'm missing some vital knowledge, I'd really appreciate it if someone could provide me a similar example of what I'm trying to achieve so I can modify that example and learn from it.

          Comment


            #6
            Found some old code of mine that I used to change controllers of a monster. Heres a cut and paste so some things will need to be changed.

            Code:
            local class<Monster> NewMonsterClass;
            	local Pawn NewMonster;
            	local int ChosenMonster;
            	local PetController PC;
            
            	ChosenMonster = Rand(MonsterClassName.Length);
            	NewMonsterClass=class<Monster>(DynamicLoadObject(MonsterClassName[ChosenMonster],class'class',True));
            
            	NewMonster = Spawn(NewMonsterClass,,,NewOwner.Location + vect(100,0,100),NewOwner.Rotation);
            	if(NewMonster != None)
            	{
            		if(NewMonster.Controller != None && PetController(NewMonster.Controller) == none)
            		{
            			NewMonster.Controller.Destroy();
            			PC = spawn(class'PetzBeta_1.PetController',,, NewMonster.Location, NewMonster.Rotation);
            			PC.Possess(NewMonster);
            			PC.bGodMode = true;
            		}
            	}
            You can probably ignore the bit at the start about finding a random monster from a list and spawning it. I can't remember if this is missing anything important like NewMonster.Controller.Unpossess(). I once made a "Confusion" combo which made any monsters that came close to the player become confused and run away/attack other monsters for a short time but I can't find it.

            Comment

            Working...
            X