Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: FreezeTag Rewards

  1. #1

    Default FreezeTag Rewards

    I'm looking for a mod that will not only give the player a kill for melting, but will also reward them with something.


    For example, after one melt, the player will get one kill. After 3 melts in a row, the player will get another kill, but will also get a weapon, such as the silenced pistol... and so on and so forth.


    Any idea on how to do this? I looked around on the forum, but didn't find anything.

  2. #2

    Default

    You have to change on FT script on the part of the reward melt points to make the way you whant.

    On this place:


    award_melter_points local.melters:
    if (level.mef_baseversion == "aa" || level.mef_baseversion == "sh" || level.mef_baseversion == "bt")
    {
    for (local.i = 0; local.i < local.melters.size; local.i++)
    {
    local.melter = local.melters[local.i]
    if (local.melter != NULL)
    {
    if (local.melter.ft_meltscore == NIL)
    {
    local.melter.ft_meltscore = 0.0
    local.melter.ft_awardedpoints = 0
    }

    local.melter.ft_meltscore += (1.0 / local.melters.size)
    local.totalpoints = int local.melter.ft_meltscore

    // round up to the nearest integer
    if ((local.melter.ft_meltscore - local.totalpoints) > 0.0)
    {
    local.totalpoints += 1
    }

    local.award = local.totalpoints - local.melter.ft_awardedpoints
    if (local.award > 0)
    {
    local.melter commanddelay 0 addKills local.award
    local.melter.ft_awardedpoints += local.award
    }
    }
    }
    }
    end

  3. #3

    Default

    What part of the code would i edit? local.award?

  4. #4

    Default

    This is just an idea, I'm not sure if it will work.
    you can add a 'switch' so you can check the amount of melts and add the custom rewards you want

    if (local.award > 0)
    {
    local.melter commanddelay 0 addKills local.award
    local.melter.ft_awardedpoints += local.award

    // not sure if 'local.melter.ft_awardedpoints' is where the melts are stored
    switch (local.melter.ft_awardedpoints)
    {
    case 1: // 1 melt
    // do stuff here
    break;
    case 2: // 2 melts
    // do stuff here
    break;
    case 3: // 3 melts
    // do stuff here
    local.melter give "models/weapons/silencedpistol.tik"
    break;
    case 4: // 4 melts
    // do stuff here
    break;
    case 5: // 5 melts
    // do stuff here
    break;
    default:
    break;
    }
    }

  5. #5

    Default

    I gave it a shot, with no sucess. It crashes when you try to melt someone.


    award_melter_points local.melters:

    if (level.mef_baseversion == "sh" || level.mef_baseversion == "bt" || level.mef_baseversion == "aa")
    {
    for (local.i = 0; local.i < local.melters.size; local.i++)
    {
    local.melter = local.melters[local.i]
    if (local.melter != NULL)
    {
    if (local.melter.ft_meltscore == NIL)
    {
    local.melter.ft_meltscore = 0.0
    local.melter.ft_awardedpoints = 0
    }

    local.melter.ft_meltscore += (1.0 / local.melters.size)
    local.totalpoints = int local.melter.ft_meltscore

    // round up to the nearest integer
    if ((local.melter.ft_meltscore - local.totalpoints) > 0.0)
    {
    local.totalpoints += 1
    }

    local.award = local.totalpoints - local.melter.ft_awardedpoints


    //NEW REWARDS START HERE ------------------------------------------------------------------
    if (local.award > 0)
    {
    local.melter commanddelay 0 addKills local.award
    local.melter.ft_awardedpoints += local.award

    // not sure if 'local.melter.ft_awardedpoints' is where the melts are stored
    switch (local.melter.ft_awardedpoints)
    {
    case 1: // 1 melt
    // do stuff here
    local.melter addkills local.award
    local.melter iprint ("You got a point for your melting.")
    break;
    case 2: // 2 melts
    // do stuff here
    local.melter give "models/weapons/silencedpistol.tik"
    local.melter iprint ("You got a silenced pistol for your melting.")
    default:
    break;
    }
    }
    }
    }
    }

    end

  6. #6

    Default

    Notice, in the code you posted, at the en of the "case 2:" you were missing a "break" statement
    that was probably causing the crash
    also you are adding kills 2 times (lines 31 and 39)
    you should keep only one (in every single melt or in specific melts), so the player won't get 2 kills in the first melt

    Try this, I tested it and it worked

    award_melter_points local.melters:

    if (level.mef_baseversion == "sh" || level.mef_baseversion == "bt" || level.mef_baseversion == "aa")
    {
    for (local.i = 0; local.i < local.melters.size; local.i++)
    {
    local.melter = local.melters[local.i]
    if (local.melter != NULL)
    {
    if (local.melter.ft_meltscore == NIL)
    {
    local.melter.ft_meltscore = 0.0
    local.melter.ft_awardedpoints = 0
    }

    local.melter.ft_meltscore += (1.0 / local.melters.size)
    local.totalpoints = int local.melter.ft_meltscore

    // round up to the nearest integer
    if ((local.melter.ft_meltscore - local.totalpoints) > 0.0)
    {
    local.totalpoints += 1
    }

    local.award = local.totalpoints - local.melter.ft_awardedpoints

    // NEW REWARDS START HERE ------------------------------------------------------------------
    if (local.award > 0)
    {
    local.melter commanddelay 0 addKills local.award // <-- this will add a kill every single melt
    local.melter.ft_awardedpoints += local.award

    switch (local.melter.ft_awardedpoints)
    {
    case 1: // 1 melt
    // do stuff here
    local.melter iprint ("You got a point for your melting.")
    break
    case 2: // 2 melts
    // do stuff here
    local.melter give "models/weapons/silencedpistol.tik"
    local.melter iprint ("You got a silenced pistol for your melting.")
    break
    default:
    break
    }
    }
    }
    }
    }
    end

  7. #7

    Default

    It is still crashing after melting someone. I'm assuming that switch won't work?

  8. #8

    Default

    Is the log file showing any error?
    and what freeze-tag version are you running? (you can see it at the top of the global/libmef/ft.scr file)

    I tested it on Version 1.3.2 (05/14/05), and it worked flawlessly

  9. #9

    Default

    Your server is on linux?

    Could be something about the command giving a kill point.

  10. #10

    Default

    This is the error that is showing in the log.

    Code:
    Got signal 11 - Segmentation fault, faulty address is 0xe4d7a0c0
    Crash Recover Attempt will take place!

    Yes, it is a linux server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •