UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

scripting a perk

broken avatar :(
Created 12 years ago
by Stuffed_Oatmeal
0 Members and 1 Guest are viewing this topic.
5,463 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
ok so im at a stand still with a perk i want to script and i dont know how to code it so it adds more damage toy your weapons like 25% damage, could any one help me?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 5 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
There are tutorials for Double Tap 2.0 on the internet, which is basically code that does double the damage. Just modify that to only do 25% more and you should be good.

- Phil.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
if keep finding the same tut and the script download is deleted do you have the script?
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 5 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
Unfortunately not, but you can look at the ZCT Mod's code (_zombiemode_spawner.gsc I believe), as they have such a perk too.

- Phil.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
all i need is the code that makes the damage double

Post Merge: September 28, 2013, 11:08:14 pm
im still going to need help i have no idea what im doing when it comes to scripts
Last Edit: September 28, 2013, 11:08:14 pm by Stuffed_Oatmeal
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,653Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
Just find the zombie_damage() function in _zombiemode_spawner, add a check to see if the attacker hasPerk(yourperk), and if so, multiply damage by 0.25 and doDamage(damage * .25, attacker, etc). You can't intercept damage to AI before it happens, you can only affect what happens after they have been damaged. I managed to do a workaround for headshots only mode where the zombies are protected by a bullet shield unless I allow the damage, but that's the only way I've found to intercept AI damage. Player damage is much easier to manipulate because you can intercept it.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
ok so add a new function called zombie_damage()
and then add beneath it
Code Snippet
Plaintext
{
          ifPlayerHasPerk(specialty_bulletaccurracy)
                 seldDo.Damage(damage *25,attacker)
 }

would that do it?
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,653Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
The function already exists, which is why I told you where to find it (_zombiemode_spawner.gsc).

Code Snippet
Plaintext
if(attacker hasPerk("theperkyouareusingfordamage"))
{
    self DoDamage(damge * 0.25, self.origin, attacker);
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
i got a server script compile error when i added that for the word damge and then i changed it to damage and got the same thing

Post Merge: September 30, 2013, 11:58:16 pm
line 1872
Last Edit: September 30, 2013, 11:58:16 pm by Stuffed_Oatmeal
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,653Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
i got a server script compile error when i added that for the word damge and then i changed it to damage and got the same thing

Post Merge: September 30, 2013, 11:58:16 pm
line 1872
Oh I forgot, gameskill doesn't pass the damage to the global damage func. Copy _gameskil.gsc into your mod's folder and add modify the first few lines of the aa_player_attacks_enemy_with_ads() function to look like this:

Code Snippet
Plaintext
aa_player_attacks_enemy_with_ads( player, amount, type, point )
{
if(player hasPerk("theperkyouareusingfordamage"))
{
    self DoDamage(amount* 0.25, self.origin, player);
}
aa_add_event( "aa_player_damage_dealt", amount );
assertex( getdvarint( "aa_player_damage_dealt" ) > 0 );
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
do i need to add that to ugxmod.iwd or no?
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,653Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
do i need to add that to ugxmod.iwd or no?
Any IWD will do, it's not currently being used in any of them which means it doesnt matter where you put it.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
server script compile error

uninitialised variable 'damage' file(_zombiemode_spawners.gsc
self DoDamage(damage * 0.25, self.origin, attacker);

thats what i get now
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,653Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms.
server script compile error

uninitialised variable 'damage' file(_zombiemode_spawners.gsc
self DoDamage(damage * 0.25, self.origin, attacker);

thats what i get now
lol you didn't take the code out of _zombiemode_spawner.gsc first...
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 May 2013
Last active: 9 years ago
Posts
126
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
Stuffed_Oatmeal's Contact & Social LinksStuffedOatmeal
oh geez wow

Post Merge: October 01, 2013, 01:09:54 am
trem your a god
Last Edit: October 01, 2013, 01:09:54 am by Stuffed_Oatmeal

 
Loading ...