Raised This Month: $51 Target: $400
 12% 

[TF2]Realistic/Campaign mod for TF2 - almost done


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cellercelleriac
Junior Member
Join Date: Oct 2020
Location: Jardín
Old 10-19-2020 , 19:21   [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #1

Hi everyone,
I´ve always liked playing tf2 but my head hurts from it sometimes. So I came up with this new gameplay mod which would focus more on teamwork and scheming and a little less on skills executed in real time.

THE PLUGIN IS ALREADY WORKING! It´s a complete mess though. I´m not good at coding (I tried to learn sourcepawn just for this mod) so I need help with revising it. Any help just as checking the main weaknesses of my poor scripting and suggesting a correction would be greatly appreciated.


Note - the map file required for this mod is too big, I can´t upload it here. Part of the mod is coded there (respawn times etc.), that all works fine though.
Attached Files
File Type: zip required plugins.zip (76.2 KB, 67 views)
File Type: txt mod description.txt (2.2 KB, 84 views)
File Type: sp Get Plugin or Get Source (tf2rpg.sp - 157 views - 13.1 KB)
File Type: sp Get Plugin or Get Source (tf2rpg02.sp - 153 views - 16.8 KB)
__________________
English is my native language not

Last edited by cellercelleriac; 10-20-2020 at 14:35.
cellercelleriac is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 10-19-2020 , 22:52   Re: [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #2

A couple of things I'd suggest:
  • Instead of enabling cheats in order to force the round to win, just strip the flag from it instead.
  • Instead of using server commands to create the weapons for the player, I'd use TF2Items to just manually do that.
  • If you hook Spawn instead of SpawnPost for ammo packs and just return stop on it, that'll do the same thing as killing them after they've spawned already.
  • I'd move the server commands which you execute OnMapStart to OnConfigsExecuted instead and use ConVar functions instead to set them.

Code:
stock void TF2_ForceWin(TFTeam team = TFTeam_Unassigned)
{
	int iFlags = GetCommandFlags("mp_forcewin");
	SetCommandFlags("mp_forcewin", iFlags &= ~FCVAR_CHEAT);
	ServerCommand("mp_forcewin %i", view_as<int>(team));
	SetCommandFlags("mp_forcewin", iFlags);
}
https://github.com/Drixevel/sourcemo...c-tf.inc#L2659

Last edited by Drixevel; 10-19-2020 at 22:56.
Drixevel is offline
cellercelleriac
Junior Member
Join Date: Oct 2020
Location: Jardín
Old 10-20-2020 , 14:31   Re: [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #3

Thanks a lot.
The cheat flag and the ammo pack thing works great, I´ve already corrected that in my code.
(I haven´t tried to mess with the ConVars yet.)

I can´t run the give item stock though (I have included the defines). I have searched the internet but I couldn´t find a guide on that. I tried to hook it somehow but nothing worked (error 100: function prototypes do not match). Could you please explain how to do that?

I´ve updated the script in the attachments.


By the way, did you write all those stocks? Props to that. I´ll be returning to that a lot (if I manage to get it working).
__________________
English is my native language not
cellercelleriac is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 10-20-2020 , 14:54   Re: [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #4

Quote:
Originally Posted by cellercelleriac View Post
Thanks a lot.
The cheat flag and the ammo pack thing works great, I´ve already corrected that in my code.
(I haven´t tried to mess with the ConVars yet.)

I can´t run the give item stock though (I have included the defines). I have searched the internet but I couldn´t find a guide on that. I tried to hook it somehow but nothing worked (error 100: function prototypes do not match). Could you please explain how to do that?

I´ve updated the script in the attachments.


By the way, did you write all those stocks? Props to that. I´ll be returning to that a lot (if I manage to get it working).
Make sure the parameters all match the same data types. Yeah, I wrote/added/edited most of them.
Drixevel is offline
cellercelleriac
Junior Member
Join Date: Oct 2020
Location: Jardín
Old 10-20-2020 , 17:58   Re: [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #5

Ok, I managed to get it working. I had completely misunderstood how these stocks work, this is easier to use than I thought .

However putting in more than one attribute doesn´t work for me. How do you do that?
Code:
  TF2_RemoveWeaponSlot(client, 0);
  TF2_GiveItem(client, "tf_weapon_scattergun", 45, TF2Quality_Normal, 100, "'2 ; 5' '44 ; 0'"); //compiled, but script cowardly refused
                                                                                                 //to add invalid attribute index 0 (in game, after spawn)
                                                                                                 //(both attributes alone work though)
I think I should have better posted this in Scripting..
__________________
English is my native language not
cellercelleriac is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 10-21-2020 , 01:53   Re: [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #6

Quote:
Originally Posted by cellercelleriac View Post
Ok, I managed to get it working. I had completely misunderstood how these stocks work, this is easier to use than I thought .

However putting in more than one attribute doesn´t work for me. How do you do that?
Code:
  TF2_RemoveWeaponSlot(client, 0);
  TF2_GiveItem(client, "tf_weapon_scattergun", 45, TF2Quality_Normal, 100, "'2 ; 5' '44 ; 0'"); //compiled, but script cowardly refused
                                                                                                 //to add invalid attribute index 0 (in game, after spawn)
                                                                                                 //(both attributes alone work though)
I think I should have better posted this in Scripting..
Code:
TF2_GiveItem(client, "tf_weapon_scattergun", 45, TF2Quality_Normal, 100, "2 ; 5 ; 44 ; 0");
Drixevel is offline
cellercelleriac
Junior Member
Join Date: Oct 2020
Location: Jardín
Old 10-21-2020 , 07:06   Re: [TF2]Realistic/Campaign mod for TF2 - almost done
Reply With Quote #7

Thx
__________________
English is my native language not
cellercelleriac is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:50.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode