Announcement

Collapse
No announcement yet.

Interaction from PlayerController

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

    Interaction from PlayerController

    I add my interaction to a player with:

    Code:
    if ((Viewport(Player) != None) && (!bHasMyInteraction))
        {
            Log(self.Name@" now has interaction!");
    
            bHasMyInteraction = True;
            Player.InteractionMaster.AddInteraction("MyMod.MyInteraction", Player);
        }
    It works but when the game ends and a new map starts the player now has 2 interactions. bHasMyInteraction doesn't seem to persist while the interaction itself does. Do I need to make the bool persist also or should I search the playercontrollers interaction list? I'm not sure the best way to handle this.

    thanks
    ian

    #2
    I found the answer in the wiki, I hadn't read all the pages on interactions and finally made it to the right one .. the answer lies in a new function available since 2236 ( i believe ) here is the code for anyone else who needs it :

    Code:
    event NotifyLevelChange()
    {
            Master.RemoveInteraction(self);
        //  (destroy any actors spawned by this interaction)
        //  (clean up any uscript objects that have been loaded)
    }

    Comment

    Working...
    X