• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DestroyOnKillcam?
#1
I got a bunch of "SetTexts" on the screen in my mod, and during the killcam, some of them tend to bounce around annoyingly. Just asking if any1 knows how to remove them during the killcam. (Gametype is SnD and some people like to record)
  Reply
#2
Code:
cleanUpOnEnd()
{
    while(1)
    {
        level waittill("game_ended");

        elemname destroy();
        elemname destroy();
        elemname destroy();
        elemname destroy();
        elemname destroy();
    }
}

on init()
Code:
level thread cleanUpOnEnd();

not sure if game_ended is when the game really ends or when it shows the winner etc
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

[-] The following 1 user says Thank You to iAegle for this post:
  • isokasi
  Reply
#3
Thx for helping, ill try it tomorrow. (Way to tired ATM)
However, I did find this while i was browsing trough some GSC's
Code:
if ( game["state"] == "playing" && !isInKillcam()
{
    infotext destroy();
}

EDIT: Just askin, shouldnt there be a "wait .1" after the last "elemname destroy();" ? Tongue
  Reply
#4
(05-01-2011, 20:08)isokasi Wrote: Thx for helping, ill try it tomorrow. (Way to tired ATM)
However, I did find this while i was browsing trough some GSC's
Code:
if ( game["state"] == "playing" && !isInKillcam()
{
    infotext destroy();
}

EDIT: Just askin, shouldnt there be a "wait .1" after the last "elemname destroy();" ? Tongue
Dunno if that will work, and you dont need a wait because there is a Waittill in the while loop ^^
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply
#5
I see, didnt think of that :>

EDIT: if ( game["state"] == "playing" && !isInKillcam() ), didnt work. But when i use your version it disappears when i kill the last guy, but appears again in the killcam.
  Reply
#6
(05-01-2011, 20:57)isokasi Wrote: I see, didnt think of that :>

EDIT: if ( game["state"] == "playing" && !isInKillcam() ), didnt work. But when i use your version it disappears when i kill the last guy, but appears again in the killcam.

ok that sucks but here:
Code:
if ( game["state"] == "playing" && [b][size=x-large]![/size][/b]isInKillcam() )

the ! = NOT which means this will run while the player is playing and is not looking at a killcam.. try
Code:
isInKillcam()

something like this:
Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");
        self thread hideInKillcam();
    }
}

hideInKillcam()
{
    self endon("disconnect");
    
    while(1)
    {
        if(self isInKillcam())
        {
            self.text.alpha = 0;
            self.text2.alpha = 0;
            self.text3.alpha = 0;
            self.text4.alpha = 0;
            self.text5.alpha = 0;
            self.text6.alpha = 0;
        }
        else    
        {
            self.text.alpha = 1;
            self.text2.alpha = 1;
            self.text3.alpha = 1;
            self.text4.alpha = 1;
            self.text5.alpha = 1;
            self.text6.alpha = 1;
        }
    }
}
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

[-] The following 1 user says Thank You to iAegle for this post:
  • surtek
  Reply
#7
(05-02-2011, 11:03)iAegle Wrote:
(05-01-2011, 20:57)isokasi Wrote: I see, didnt think of that :>

EDIT: if ( game["state"] == "playing" && !isInKillcam() ), didnt work. But when i use your version it disappears when i kill the last guy, but appears again in the killcam.

ok that sucks but here:
Code:
if ( game["state"] == "playing" && [b][size=x-large]![/size][/b]isInKillcam() )

the ! = NOT which means this will run while the player is playing and is not looking at a killcam.. try
Code:
isInKillcam()

something like this:
Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");
        self thread hideInKillcam();
    }
}

hideInKillcam()
{
    self endon("disconnect");
    
    while(1)
    {
        if(self isInKillcam())
        {
            self.text.alpha = 0;
            self.text2.alpha = 0;
            self.text3.alpha = 0;
            self.text4.alpha = 0;
            self.text5.alpha = 0;
            self.text6.alpha = 0;
        }
        else    
        {
            self.text.alpha = 1;
            self.text2.alpha = 1;
            self.text3.alpha = 1;
            self.text4.alpha = 1;
            self.text5.alpha = 1;
            self.text6.alpha = 1;
        }
    }
}

Didnt work. I also asked Insignia (guy at alterIW) and he didnt know either so..
  Reply
#8
I got it! Big Grin
Code:
onPlayerSpawned()
{
    self endon("disconnect");

    for(;;)
    {
        self waittill("spawned_player");
        self thread hideInKillcam();
    }
}

hideInKillcam()
{
    self endon("disconnect");

    while(1)
    {
        if(level.showingFinalKillcam)
        {
            self.text destroy();
            self.text2 destroy();
            self.text3 destroy();
            self.text4 destroy();
            self.text5 destroy();
            self.text6 destroy();
        }
        wait .05;
    }
}

change self.textX.alpha to your own textnames ..
(08-10-2011, 12:58)Pozzuh Wrote:
Se7en Wrote:Stealed, from cod4 mod ...
look who's talking

[Release] Old School Mod v2.2
[Release] Scroll menu

  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)