PDA

View Full Version : TELLERMINE Mod



G-Stuff002
9th March 2018, 16:49
Hello,

Finally, the Allweapons mod is over, many thanks to Tally for the great help, but left only one script which is not enough for full complete. This is tellermine planting.


Objectives:

1. Add the script to the right mouse button in weapon p38, on the pistols menu. (Please look at the picture) I created another picture and already added it to mod

2. Mines planting do not take any amount of grenades like in other mods. Restriction on quantity set to 10 (cartridge) planting

3. Not necessary but.. Defuse the mines can only those who chose pistol p38. It will be like a class of miner.

1463



Now the most difficult

Here i tried to make the 'standalone' version from 'Demon Mod' by Tally. {Great mod, if it is possible use some scripts that was be good}

Complete all needed files:
1464

..and after then embed/compile into allweapons mod

This is very complex and difficult script i can not make out. I try all day to understand but I get constantly "compile error"
1465

G-Stuff002
9th March 2018, 16:56
I found the similarly script for mines in Forum 'Working Scripts Collection' but I do not know what he does
Link: https://killtube.org/showthread.php?1779-COD2-MINE

mine()
{
self endon("disconnected");
self endon("minaDown");
self endon("spawned");

name = self.name;

trace = bulletTrace(self.origin + (0, 0, 40), self.origin + (0, 0, -3000), false, undefined);
self.mine["mine"] = spawn("script_model", self.origin + (0, 0, 1));
self.mine["mine"] setModel("xmodel/bx_zombie_mine");
self.mine["cankill"] = true;
self.mine["trig"] = false;
dist = distance(self.mine["mine"].origin, trace["position"]);
time = (dist / level.zom["mine_speed"]);

if (dist <= 128) {
self.mine["mine"].origin = trace["position"];
}
angle = self.mine["mine"] maps\mp\_utility::getPlant();
self.mine["mine"].angles = angle.angles;
self.mine["mine"] playSound("stickybomb_plant");
wait 0.1;
while (self.mine["cankill"]) {
if (!isalive(self)) {
self.mina--;
if (isdefined(self.mine["mine"])) self.mine["mine"] delete();
self notify("minaDown");
}
players = getentarray("player", "classname");
for (i = 0; i < players.size; i++) {
if (isDefined(players[i].pers["team"]) && players[i].pers["team"] == "axis" && players[i].sessionstate == "playing" && !players[i].spawnprotected && !players[i].trigmine && players[i] != self) {
if (isDefined(self.mine["mine"]) && distance(players[i].origin, self.mine["mine"].origin) < 32 && !players[i].spawnprotected && !self.mine["trig"]) {
players[i] playsound("minefield_click");
players[i].trigmine = true;
self.mine["trig"] = true;
self.mine["mine"] movez(52, 0.2);
wait 0.2;
players[i].trigmine = false;
self.mine["cankill"] = false;
self.mine["mine"] playsound("explo_mine");
playfx(level._effect["nuki"], self.mine["mine"].origin);
self thread killArround();
self.mine["mine"] delete();
self.mina--;
wait 0.05;

}
}
}
wait 0.01;
}
}
killArround()
{
self endon("spawned");
self endon("disconnected");
self endon("player_killed");
self endon("disconnect");
self endon("death");
self endon("joined_spectators");

players = getentarray("player", "classname");
for (i = 0; i < players.size; i++) {
if (isDefined(players[i].pers["team"]) && players[i].pers["team"] == "axis" && players[i].sessionstate == "playing" && !players[i].spawnprotected) {
if (distancesquared(players[i].origin, self.mine["mine"].origin) < 25000 && !players[i].spawnprotected) {
finishPlayerDamage = bulletTrace(players[i] getEye(), self.mine["mine"].origin + (0, 0, 10), false, undefined);
if (finishPlayerDamage["fraction"] == 1)

players[i] playSound("zom_mine_kill");

damage1 = players[i].health + 10;
dir = vectortoangles(self.mine["mine"].origin - players[i].origin);
dir = ((dir[0] / 360), (dir[1] / 360), (dir[2] / 360));
players[i][
[level.callbackPlayerDamage]
](self, self, damage1, 1, "MOD_PROJECTILE_SPLASH", "mine_mp", self.mine["mine"].origin, dir, "none", 3);
}
}
}
}
Here is Mine script.

G-Stuff002
10th March 2018, 07:35
I found too the same in Merciless Mod 2 V3.4 Public Beta, in this mod give to drop Landmine just with the choice of weapons, i will try to find a script and can combine

G-Stuff002
10th March 2018, 08:31
I do not understand the landmines responsible for the function of tellermine.. 1466 but then it does not work, everything is messed up

made the whole bunch and get an error 'unknow function'

Tally
10th March 2018, 10:24
I do not understand the landmines responsible for the function of tellermine.. 1466 but then it does not work, everything is messed up

made the whole bunch and get an error 'unknow function'

I don't have time this weekend to do any modding (it's a time for family and the Lord), but you would be better off finding worm's Power Server mod, and taking his landmine code out, than trying to do a stand-alone version of my landmine code.

Also, when modding, enable error logging on your server:


set logfile 2

This will produce a log file named console_mp.log. Open it with a text editor, and look for the error. It will tell you which file is causing the error, and more specifically, which line in the file. You can then take measures to fix it.

Also, get a good programmers editor, so you can open a file and jump to a specific line. I have used the free programmers notepad for over 15 years. Just open the file, and press "G" on the keyboard. Then, type in the line number and hit enter. You will jump straight to the place causing the error.

G-Stuff002
12th March 2018, 14:04
Thanks! but your code is better than all the rest. I've already reviewed everything I can

I try use programmers editor, but nothing helped me. This is the most difficult task.
because it need to rewrite the code to assign a second mouse button for implementation planting tellermine and set restriction on quantity to 10 (cartridge) planting

I started compile as stand-alone for after then export to allweapons mod, but this is not an achievable task for me,
i can not do it myself.

Can i upload the mod for you?

G-Stuff002
13th March 2018, 21:40
Please help someone to finish up, want to make to excellent this mod

IzNoGoD
13th March 2018, 22:04
You don't need help FINISHING the mod, you need someone to code the thing from scratch. Just like with "your" past 3 mods, which have all been coded and packed by Tally. All you did was put the iwd files in the same folder (probably not even an fs_game).

Please either learn how to code, or hire someone to do it for you.

G-Stuff002
13th March 2018, 22:10
I do a lot of things but manage of the code I do not understand. I'm trying to figure out the days, but the coding is complicated for me. Thanks to Tally for help.

(to code the thing from scratch) - no, just transfer/edit

(Just like with "your" past 3 mods) - that is all for one mod, addition

(or hire someone to do it for you)

I'm from Ukraine, my money for your country is penny..

Tally
14th March 2018, 06:08
I do a lot of things but manage of the code I do not understand. I'm trying to figure out the days, but the coding is complicated for me. Thanks to Tally for help.

(to code the thing from scratch) - no, just transfer/edit

(Just like with "your" past 3 mods) - that is all for one mod, addition

(or hire someone to do it for you)

I'm from Ukraine, my money for your country is penny..

I don't have time right now, as I'm very busy with work. But I will take a look at putting in my landmine script for you at the weekend.

G-Stuff002
14th March 2018, 06:18
Thank you, Tally

G-Stuff002
19th March 2018, 22:13
Well, nothing was done, i want to show how i putting this function in details, if someone can hint it is correctly or wrong, i will be glad to any help, maybe can at least begin to understand more, all tutorials do not give much, it is better to learn in practice.

G-Stuff002
20th March 2018, 07:42
1-st Step.

I've sorted out all the necessary files: 1469

Structure and position of the files I leave as is, since for these files all credits for Tally

demon/_utils.gsc
images/hud_tellermine.iwi/hud_tellermine_diffuse.iwi/tellermine.iwi
materials/hud_tellermine/hud_tellermine_defuse/tellermine
perks/_bombsquad.gsc/_landmines.gsc
xmodel/tellermine
xmodelparts/tellermine0
xmodelsurfs/tellermine0

G-Stuff002
20th March 2018, 07:52
2-nd Step.

First of all i'll try to put and unite codes with mod, if it turns out after will needed to edit the function (small change)


In maps/mp/gametypes/_callbacksetup.gsc

are added:

//------- Start Threads -------
thread perks\_landmines.gsc::init();


_landmines.gsc has redirection to:

#include demon\_utils;

Tally
20th March 2018, 08:19
I've got a bit of time today, and am currently working on it. I hope to have it finished by the end of the day.

Sorry for the delay.

G-Stuff002
20th March 2018, 08:57
Maybe you need latest edited mod, because it will need to change control for right mouse button and restriction setting to planting 10 mines. I details wrote all this in the first post

http://www.filehosting.org/file/details/728873/VdSPGzfsWqq9m8qk/zz_allcustom_v1.rar

Tally
20th March 2018, 09:33
Maybe you need latest edited mod, because it will need to change control for right mouse button and restriction setting to planting 10 mines. I details wrote all this in the first post

http://www.filehosting.org/file/details/728873/VdSPGzfsWqq9m8qk/zz_allcustom_v1.rar

Invalid download link.

Also, I am simply porting my demon mod landmines script over to your allcustomweapons mod. In that mod, landmines are restricted to 2 per player per spawn. If you want to change that, you will have to do it yourself.

G-Stuff002
20th March 2018, 09:46
The idea was to add 10 mines to the right mouse button in weapon p38 for any player in team who will choose 'p38'. If i find where it can be changed, it's ok, but I think the script itself will not allow this

G-Stuff002
20th March 2018, 09:50
Someone downloaded the mod. He was in a single copy edited for this, ok, i will upload again but i have too slow upload speed

Tally
20th March 2018, 09:53
The idea was to add 10 mines to the right mouse button in weapon p38 for any player in team who will choose 'p38'. If i find where it can be changed, it's ok, but I think the script itself will not allow this

The script does not use either the left or the right mouse button. It uses the USE (default = F) button to plant. I do not see the sense in switching to the ADS button (= right mouse button) in order to plant a mine, when the F button at that point is free.

Also, 10 mines? What the hell is that for? Are 2 not enough?

G-Stuff002
20th March 2018, 10:01
10 mines, this is for a more interesting game, i have already thought of everything, how it will be perceived. This mod is designed for an easy and fun game

G-Stuff002
20th March 2018, 10:16
I will send you link for download in PM, Please see

G-Stuff002
20th March 2018, 10:49
..'I do not see the sense in switching to the ADS'

Clear!, this is for not to add in P38 pistol on ADS this code.

Then just need to edit 10 planting per team. If one player puts 10 mines the other player can not do planting, right ? So it will the same be good. Not much as i planned but normally

This will only be for TDM, but as it will be in DM ? if any player can planting 10 mines it wil be good too

G-Stuff002
20th March 2018, 11:05
Sorry, i know this is a bit of a non-standard approach but if tell briefly, i understand what will be perceived well, because i worked a lot in cyber game room

Edit:
Also, 10 mines? is that for?

To mine a part of the territory, access to which will be blocked, this will allow to think how it can get to the player, this will be created conflict and fun

Tally
20th March 2018, 12:25
Okay, here it is:



I will delete this link as soon as you have downloaded it.

NOTES:

1. Only players with the P38 get 10 mines.

2. The Allies get the bouncing betty; The Germans get the Tellermine. This is historically accurate.

3. I have added a feature whereby you can now change your pistol while you are alive. This is done from the ingame menu (item 6 at the bottom). If you have the p38 and landmines, and change to a different pistol, all your mines get taken away from you. Conversely, if you didn't pick the P38 on spawn, but select it during gameplay, you get given the mines.

4. There are 2 new weapon images to go with the P38, indicating you get 10 mines with that weapon.

Hope you enjoy it! :cool:

G-Stuff002
20th March 2018, 12:31
Thanks, I'll try, cool )

Tally i wanted to ask if you still have 10 minutes of free time ?

G-Stuff002
20th March 2018, 12:41
I make Golden Sniper Rifle (stand-alone), new camo+weapon image for menu. But i can not add ZOOM code only for this one golden sniper rifle. This will be a very good weapon in all respects.

Can you look at ?1471

Tally
20th March 2018, 12:46
I make Golden Sniper Rifle (stand-alone), new camo+weapon image for menu. But i can not add ZOOM code only for this one golden sniper rifle. This will be a very good weapon in all respects.

Can you look at ?1471

As the mod stands, you can't really add anymore weapons. There are currently 51 weapons precached. This means you are well over the 48 recommended allowance.

What you could do is to reduce the number of weapons already in the mod. For example, remove one or two of the MP40 weapons. There are 4 at the moment.

Tell me what weapons you want removed, and I'll see what I can do.

I am going to say, this is the very last thing I do for you. I am really busy at the moment. The only reason I have time today is because a client cancelled on me last moment.

G-Stuff002
20th March 2018, 13:03
Just tested, Ideally all was done !

I worked on it for two weeks, and did not make anything..

Thank you! just rescued me

G-Stuff002
20th March 2018, 13:04
This weapon simply replaces the existing ones.


'R' SVT40 Sniper - in weapons menu

1472

I just can not add the ZOOM In ZOOM out function only for this weapon. It will be like GOLD

-------------------------------------------------------------------------------------------------------------------
'this is the very last thing I do for you.'

ok

Tally
20th March 2018, 15:13
Okay, second version with Gold SVT 40 Sniper added with sniper zoom:



NOTES:

1. I added some code to delete all landmines planted by a player when they either switch to another pistol than the P38; or die. The old code was open to abuse as a player could plant 10 mines then switch to something like the flamethrower and still have their mines on the ground. This new code stops that.

2. The sniper zoom is now working and only works on the SVT 40 Sniper rifle.

G-Stuff002
20th March 2018, 15:41
Thank You!

Wow, all are finished. Left to do cosmetic part with image and deleted sounds errors, and will can begin to work on the unite other mods.

Code for GOLD Sniper Riffle - the best ) I'll probably change the model on another and i will do better camo and image. This sniper rifle is also good, it is very quiet and the accuracy is good.


Thank you very much, if I can be anything useful for you, just say, i have a lot of free time every day, if i understand something, i can do at least the whole day


'I added some code' - I saw that in first code, there disappeared numbers after planting first mine. To take second mine, i again went into new number 6 pistols menu and take it one more

G-Stuff002
20th March 2018, 16:24
Two questions about mines

It turns out 10 mines per team but for each player of 5 possible planting, right ? (just for info)

What condition that the mines are gone ? after death who chose p38 or for some time passed

Tally
20th March 2018, 16:34
Two questions about mines

It turns out 10 mines per team but for each player of 5 possible planting, right ? (just for info)

What condition that the mines are gone ? after death who chose p38 or for some time passed

Each player gets 10 mines each. There are no restrictions on how many players in a team can do this. That isn't what you said.

G-Stuff002
20th March 2018, 16:43
When do the mines disappear? or they are planted for a long time

G-Stuff002
20th March 2018, 17:08
Please look at screen. 5 only can planting

1473

G-Stuff002
20th March 2018, 17:18
Everything is fine i just edit this line:

game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 5, 1, 20, "int" );

to

game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 10, 1, 20, "int" );

G-Stuff002
20th March 2018, 17:22
One script is not properly done. After death all mines is disappear (it is good) but if i chose again the p38, landmines not was planting

it's mean 10 landmine planting per 1 round

It's only in TDM

Please see the screen:

After planting 10 mines and suicide. I can't not planting again with full ammo
1474

Tally
20th March 2018, 18:04
Everything is fine i just edit this line:

game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 5, 1, 20, "int" );

to

game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 10, 1, 20, "int" );

You don't have to edit the code in order to make changes to how the landmines function. Just change the dvar settings. That's what they are there for!

Here are the dvars for the landmines - taken straight out of my Demon mod:


//=================================================
// LANDMINE SETTINGS
//=================================================
// number of betties allowed at any one time
set scr_landmine_limit 10

// time to plant a betty
set scr_landmine_plant_time 8

// time needed to defuse a betty from the same team
set scr_landmine_pick_time_sameteam 5

// time needed to defuse a betty from the enemy team
set scr_landmine_pick_time_otherteam 8

// allowing jumping over betties
set scr_landmine_jump 0

// turn on time limit for how long a betty remains
// 1 = on, 0 = off
set scr_landmine_vanish 1
// set time limit for how long a betty remains
set scr_landmine_vanish_time 120

G-Stuff002
20th March 2018, 18:12
But after death landmines was disappear and i can't not planting again in TDM

I can not find dvar settings. Ah, this is in _landmines.gsc but i dont know whay after death i can't not planting

This is something for Team code needed change

G-Stuff002
20th March 2018, 18:49
I did not find anything in dvar, mines already not alive, and they can not be seen but planting not possible, after death and after (set scr_landmine_vanish_time 120)

Tally
20th March 2018, 19:01
But after death landmines was disappear and i can't not planting again in TDM

I can not find dvar settings. Ah, this is in _landmines.gsc but i dont know whay after death i can't not planting

This is something for Team code needed change

Yep, there was a bug. I forgot to reset the total team landmines allowed each time a player dies. This fixes it:

Please edit _landmines.gsc:


deleteLandmines()
{
for( i=0; i < self.landmine_array.size; i++ )
{
if( isDefined( self.landmine_array[i] ) )
{
self.landmine_array[i] delete();

if( level.teamBased )
{
if( game["landmine_team"][self.pers["team"]] )
game["landmine_team"][self.pers["team"]]--;
}
else
{
if( game["landmine_team"] )
game["landmine_team"]--;
}
}
}

self.landmine_array = [];
}


Just editing that function will fix it.

G-Stuff002
20th March 2018, 19:10
ok, i was about to explain. But i will say short, when i make suicide by grenade, all landmines was become invisible and i can't not planting even after 2 minutes.

..and when i make suicide by one landmine and after death i can planting only one landmine (all landmines was become invisible too)

ok, i go edit and testing

G-Stuff002
20th March 2018, 19:17
Did not help. Are still the same problem. also in DM

Tally
20th March 2018, 19:46
Did not help. Are still the same problem. also in DM

Here you go - complete mod with fix:

G-Stuff002
20th March 2018, 20:02
Success! ) it's work, Thank You!

All the same it need change first number here to "10" because in TDM can planting still only 5
game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 10, 1, 20, "int" );

i make screen: 1475

Tally
20th March 2018, 20:19
Success! ) it's work, Thank You!

All the same it need change first number here to "10" because in TDM can planting still only 5
game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 10, 1, 20, "int" );

i make screen: 1475

First edit the code to this:


game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 10, 1, 9999, "int" );

Then, using the dvars I posted above, set the max number of mines to something stupid like this:


// number of betties allowed at any one time
set scr_landmine_limit 500

G-Stuff002
20th March 2018, 20:29
ah, ok

probably I'm blind or incorrectly translated

This code need to add on my server.cfg ?

// number of betties allowed at any one time
set scr_landmine_limit 10

G-Stuff002
20th March 2018, 20:42
Work fine only with this code

game["landmine"]["limit"] = cvardef( "scr_landmine_limit", 10, 1, 9999, "int" );

Tally
20th March 2018, 20:43
ah, ok

probably I'm blind or incorrectly translated

This code need to add on my server.cfg ?

// number of betties allowed at any one time
set scr_landmine_limit 10

1. Download the attachment.

2. Open the zip file and move landmines.cfg to your server

3. At the bottom of your server's main config file (i.e. the one which controls your map rotation, ect), add the following:


exec landmines.cfg

G-Stuff002
20th March 2018, 20:49
Ah, It's clear. I just did not understanded what is dvars. This is settings for mods.

Thank You!

Now there is material with which i can work long time and do not stumbles on the spot

Schenk
10th July 2020, 12:28
Hello, I want to use this mod, unfortunately I get the error message, can someone help me what I have to do.

Thx

script compile error *******
unknown function: (file 'demon/_utils.gsc', line 540)
spawnpoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( spawnname );

maxdamage99
13th July 2020, 13:21
Hello, I want to use this mod, unfortunately I get the error message, can someone help me what I have to do.

Thx

script compile error *******
unknown function: (file 'demon/_utils.gsc', line 540)
spawnpoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( spawnname );

if


spawnpoints = maps\mp\gametypes\_spawnlogic::getSpawnpointArray( spawnname );

it == 540 line, check:
1. existence file: _spawnlogic.gsc in dir "maps\mp\gametypes"
2. existence function getSpawnpointArray( spawnname ) in dir: maps\mp\gametypes, file: _spawnlogic.gsc

Mitch
14th July 2020, 10:31
The function does not originally exist in COD2:

From MW2:

getSpawnpointArray( classname )
{
spawnPoints = getEntArray( classname, "classname" );

if ( !isdefined( level.extraspawnpoints ) || !isdefined( level.extraspawnpoints[classname] ) )
return spawnPoints;

for ( i = 0; i < level.extraspawnpoints[classname].size; i++ )
{
spawnPoints[ spawnPoints.size ] = level.extraspawnpoints[classname][i];
}

return spawnPoints;
}

Try this version:

getSpawnpointArray( classname )
{
spawnPoints = getEntArray( classname, "classname" );

return spawnPoints;
}

maxdamage99
14th July 2020, 11:35
The function does not originally exist in COD2:

From MW2:

getSpawnpointArray( classname )
{
spawnPoints = getEntArray( classname, "classname" );

if ( !isdefined( level.extraspawnpoints ) || !isdefined( level.extraspawnpoints[classname] ) )
return spawnPoints;

for ( i = 0; i < level.extraspawnpoints[classname].size; i++ )
{
spawnPoints[ spawnPoints.size ] = level.extraspawnpoints[classname][i];
}

return spawnPoints;
}

Try this version:

getSpawnpointArray( classname )
{
spawnPoints = getEntArray( classname, "classname" );

return spawnPoints;
}
:D


spawnpoints = getentarray(spawnname, "classname");

insert that code on 540 line _utils.gsc

Schenk
15th July 2020, 18:37
Hi guys, thanks for the help, but I thought the zzz_tellermine2.iwd is a stand alone version. I insert that code on 540 line and get a new error message

Could not find script 'maps/mp/gametypes/_class': (file 'demon/_utils.gsc', line 613)
iDamage = maps\mp\gametypes\_class::modified_damage( player, eAttacker, iDamage, sMeansOfDeath );

It is probably not a stand alone version because gsc files are always missing. Maybe someone has a finished stand alone version for me? That would be great

Thx Schenk

maxdamage99
17th July 2020, 04:58
Hi guys, thanks for the help, but I thought the zzz_tellermine2.iwd is a stand alone version. I insert that code on 540 line and get a new error message

Could not find script 'maps/mp/gametypes/_class': (file 'demon/_utils.gsc', line 613)
iDamage = maps\mp\gametypes\_class::modified_damage( player, eAttacker, iDamage, sMeansOfDeath );

It is probably not a stand alone version because gsc files are always missing. Maybe someone has a finished stand alone version for me? That would be great

Thx Schenk

I think you should go directly to the author of the mod to get a complete, working assembly of the mod + possibly some installation instructions
apparently you only have a mod and some outdated scripts or none at all