to my knowledge, doesnt exist in CoD4.F |Madness| U wrote:Well I know there is a function somewhere that allows you to change what you see on the scoreboard. For TDM it is something like
onScoareBoard( score, kills, deaths, assists, kdr ). So if changed `score` to `newscore`and then set up a way to save the players score to newscore, it might work? Although at the moment I have no idea how I would add it to their newscore
Small modding tasks
Moderator: Core Staff
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Small modding tasks
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Small modding tasks
On Black Ops, I found a function setScoreBoardColumns ( kills, deaths, assists, kdr ), but as you can see there isn't an option to change the score column :S
-
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Small modding tasks
I've got a problem which is probably pretty simple to do, just I have no clue how after trying to find out. Basically I want a certain weapon to do damage on someone, if they go inside a certain trigger at a certain time. I know how to script the trigger prat, I just don't know how to actually hurt the player with this certain weapon when they are inside the trigger. I want to use something like an airstrike, not an actual gun, but I don't need the FX or something, I just want the weaponfile to be applied to that player when they're inside the trigger, if you understand what I mean. -Thanks.
-
-
- CJ Worshipper
- Posts: 289
- Joined: December 5th, 2009, 7:12 am
- Location: Australia
Re: Small modding tasks
You could edit the "Callback_PlayerDamage" function in the "_globallogic_player.gsc" file in maps\mp\gametypes. This is the function that calculates the damage done. One of its parameters is the 'sWeapon' string which, I assume, is the weapon that was used to hurt the player. You can check if this equals some weapon of your choice. You could also get the trigger entity from the map and check if the player is touching it. I think this will work, good luck
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Small modding tasks
I don't think you understand That function is used to check things once they have been damaged isn't it? I want to somehow make somebody be damaged by a certain weapon, not check if they have been damaged by it.
-
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Small modding tasks
iCY I believe is correct.
The callback function for player_damage is the function that deals with any damage.
you should be able to call it yourself and insert custom parameters, where sWeapon is the weapon you want to use and iDamage is the amount of damage.
If you don't understand, will actually go look at the syntax (cba atm ) later (or someone else will respond by then).
The callback function for player_damage is the function that deals with any damage.
you should be able to call it yourself and insert custom parameters, where sWeapon is the weapon you want to use and iDamage is the amount of damage.
If you don't understand, will actually go look at the syntax (cba atm ) later (or someone else will respond by then).
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Small modding tasks
I think I understand it now! I was messing around trying to ge ta knife to do a certain amount of damage, because for some reason the knife damage varies (I think depending on where you hit the person) between about 130-140 damage. Anyway I managed to use the Callback funtion to make the knife damage always do 50, so I think I may be able to know what to do now. If I fail then be ready to see this topic bumped again in a few hours
-
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Small modding tasks
Glad for a change not to have to write the code first before an attempt is made
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Small modding tasks
20 days later and I failed! I tried something like
However I got a load of errors, I'm guessing because of all the unitialised variables. Was this the right way of making the player be damaged by artillery_mp, do I just need to make up a value for each variable?
Also, I have an array of distances (see code below), and was wondering how I can get the largest distance from the array, and relate it back to the corresponding spawnpoint.origin? I tihnk I know how I would get the cooresponding spawnpoint.origin, but I'm just unsure as to how to pick out the largest value from that array.
Code: Select all
for(i=0;i<level.players.size;i++)
    {
        player = level.players[i];
        if(isDefined(minetrigger) && player IsTouching(minetrigger) && player.team == "axis")
        {
            player thread damage(eInflictor, eAttacker, 1000, iDFlags, "MOD_EXPLOSION", "artillery_mp", vPoint, vDir, sHitLoc, timeOffset);
           Â
Also, I have an array of distances (see code below), and was wondering how I can get the largest distance from the array, and relate it back to the corresponding spawnpoint.origin? I tihnk I know how I would get the cooresponding spawnpoint.origin, but I'm just unsure as to how to pick out the largest value from that array.
Code: Select all
    dist_from_zombies = [];
    for(i = 0; i < level.spawnpoints.size; i++)
    {
        spawnpoint = level.spawnpoints[i];
        dist_from_zombies[i] = getclosest(spawnpoint.origin, axis);
    }
-
-
- CJ Worshipper
- Posts: 289
- Joined: December 5th, 2009, 7:12 am
- Location: Australia
Re: Small modding tasks
For the first problem, you do need to make up values for each variable
Second problem, you can just use a standard find maximum value algorithm. I want write the code because I'm lazy and you should do it What you want to do is create a temp variable to store the maximum value. Loop through each value in the array and do a simple if check to check if the current array item is larger than the temp one. If it is, set temp to the current value. Finally, return temp.
I pretty much just gave you the pseudo code for it :S
Second problem, you can just use a standard find maximum value algorithm. I want write the code because I'm lazy and you should do it What you want to do is create a temp variable to store the maximum value. Loop through each value in the array and do a simple if check to check if the current array item is larger than the temp one. If it is, set temp to the current value. Finally, return temp.
I pretty much just gave you the pseudo code for it :S
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Small modding tasks
Thankyou for explaining iCYSoldier, I would rather people explain than just write code out for me I managed to solve the damage problem quickly, and after a few hours managed to get a working code for what I wanted. It basically teleports you to a spawnpoint that is furthest away from a zombie, code is below if anyone is interested or wants to say what I could have improved in the code
Code: Select all
teleport()
{
    self endon("teleported");
    // -- Creates an array of players that are on zombie team
    zombies = [];
    for(i = 0; i < level.players.size; i++)
    {
        if(level.players[i].pers["team"] == "axis")
        {
            zombies = add_to_array(zombies, level.players[i]);
        }
    }
   Â
    // -- For reach spawnpoint, it finds the closest player from zombies array, and adds them into an array, then gets the distance between the spawnpoint and player, and adds the distnace into an array.
    closestzombie = [];
    dist_from_zombies = [];
    for(i = 0; i < level.spawnpoints.size; i++)
    {
        closestzombie[i] = getclosest(level.spawnpoints[i].origin, zombies);
        dist_from_zombies[i] = distance(level.spawnpoints[i].origin, closestzombie[i].origin);
    }
   Â
    // -- For each distance in the array, checks to see if its bigger than the previous, ending variable `furthest` should have the largest distance.
    furthest = dist_from_zombies[0];
    for(i = 1; i < dist_from_zombies.size; i++)
    {
        if(dist_from_zombies[i] > furthest)
            furthest = dist_from_zombies[i];
    }
    // -- Then checks the distance between each spawnpoint, and each closest zombie to that spawn.
    // -- If the distance is the same as the variable above, it puts you at that spawnpoint.
    for(i=0; i<level.spawnpoints.size; i++)
    {
        if(distance(level.spawnpoints[i].origin,closestzombie[i].origin)==furthest)
        {
            self setOrigin(level.spawnpoints[i].origin);
            self notify("teleported");
        }
    }   Â
}
-
Who is online
Users browsing this forum: No registered users and 29 guests