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

Weapon impact

HOT
broken avatar :(
Created 8 years ago
by fanmagic
0 Members and 1 Guest are viewing this topic.
6,566 views
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
Signature
Tears Of The Fallen | Join the project https://discord.gg/8gDNQRj
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
How can i get the impact point of a weapon?
Last Edit: August 05, 2016, 10:08:45 am by fanmagic
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
Signature
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Wait until the player shots and use this:
Code Snippet
Plaintext
trace = bulletTrace( <start>, <end>, <hit characters>, <ignore entity> );
impact_point = trace[ "position" ];
Use for <start> the eye of the player (player getEye()), and for <end> a far point in front of the player.

At least this is what I did.

If you want the entity hit use:
Code Snippet
Plaintext
entity = trace[ "entity" ];
Last Edit: August 05, 2016, 10:30:50 am by Soy-Yo
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
My preferred name is "xSanchez78".
Check me out here: www.steamcommunity.com/id/xSanchez78
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Wait until the player shots and use this:
Code Snippet
Plaintext
trace = bulletTrace( <start>, <end>, <hit characters>, <ignore entity> );
impact_point = trace[ "position" ];
Use for <start> the eye of the player (player getEye()), and for <end> a far point in front of the player.

At least this is what I did.

If you want the entity hit use:
Code Snippet
Plaintext
entity = trace[ "entity" ];
Well this isn't necessarily true because there is bullet spread, which you can manually script to perfect accuracy, but bullet spread is random meaning the actual weapon can hit in one point within the spread while your script could end up hitting another.
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Well this isn't necessarily true because there is bullet spread, which you can manually script to perfect accuracy, but bullet spread is random meaning the actual weapon can hit in one point within the spread while your script could end up hitting another.
Yeah, that's right. Didn't think in that. But that's the most accurate way I know... :(
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
most weapons you want the impact of are "projectile" weapons. you can use waittill("projectile_impact", weapon, impact). Cant remember if it is exactly that, but cant check at work
I try to modify your wonderweapon script only to see if its work for me. But it doesnt.

Code Snippet
Plaintext
start()
{
    flag_wait("all_players_connected");
players = GetPlayers();
array_thread(players, ::weapon_fired);
}

weapon_fired()
{
self endon( "disconnect" );
self waittill( "spawned_player" );
for( ;; )
{
self waittill( "projectile_impact", weapon, impact );
if (weapon == "zombie_colt")
{
self thread impact_fx( impact );
}

}
}

impact_fx( impact )
{
bullet = spawn("script_model", impact);
bullet SetModel("tag_origin");
playfxontag( level._effect["ww"], bullet.origin );
bullet delete();
}
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
did you make the colt into a projectile weapon? otherwise it will never work..
If you did, try without the waittill "spawned_player", depending on where you call it they might have allready spawned?
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
did you make the colt into a projectile weapon? otherwise it will never work..
If you did, try without the waittill "spawned_player", depending on where you call it they might have allready spawned?
How can i do that?
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Drag weaponfile into UGX weapons editor and change type on first page to "projectile"

^
but, a projectile weapon makes crawlers, has splash damage and doesn't have bullet-penetration ( so just like the normal ray-gun ) so it might not Always suit your needs..
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Drag weaponfile into UGX weapons editor and change type on first page to "projectile"

Edit: I also recommend you use playfx( fx, origin) instead of spawning the ent and playingfxontag. No need to make an ent for that.
To further explain:
Playfxontag has the advantage of being played on an entity while it is defined. Delete the model and the fx will stop. Best for looping fx.
Playfx has the advantage of not needing an entity and is best with "one shot" fx. For anything static playfx is usually best
Thanks for the explanation. But now i get this error.
Last Edit: August 05, 2016, 01:24:30 pm by fanmagic
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Ahh forgot there is a bit of modifications needed for a projectile weapon in the settings. Open up the IWD for my Afterlife and look at my weaponfile. I can imagine you are trying to make a custom WW? Could also look at my Atomic Levitator weaponfile in my weapons. Typically I copy and paste the zombie_colt_upgraded and change the things I want to get the settings right
Yes. That's what i would like to make. Testing it now...


Double Post Merge: August 05, 2016, 01:42:52 pm
Works perfect now. Thanks. But how can i move the fx a little bit higher?
Last Edit: August 05, 2016, 01:42:52 pm by fanmagic
broken avatar :(
×
broken avatar :(
Location: esMadrid
Date Registered: 27 March 2015
Last active: 3 years ago
Posts
371
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
JIGGLYPUFF used SING! YOU fell asleep!
×
Soy-Yo's Groups
Soy-Yo's Contact & Social LinksSoy-yoElCerdoRey
Yes. That's what i would like to make. Testing it now...


Double Post Merge: August 05, 2016, 01:42:52 pm
Works perfect now. Thanks. But how can i move the fx a little bit higher?
(Image removed from quote.)
Sum something to the impact_point:
Code Snippet
Plaintext
impact_point += ( 0, 0, z );
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 30 December 2012
Last active: 9 months ago
Posts
577
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
alaurenc9's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
alaurenc9's Contact & Social LinksxSanchez78xSanchez78xSanchez78xSanchez78xSanchez78xSanchez78
Well if you make the colt a projectile weapon, it no longer does bullet damage. And you must set a speed for the bullet to reach it's target.... in other words it won't be instantaneous like a real life bullet. And you can't do penetration damage, where it goes through zombies.... you can only do impact damage to the first zombie and a radius damage after that. And the impact damage is just one set of damage, unlike bullets where you can set min/max damage and then distances, and it only gives you +50, so there is no headshot points or even a specified hit location to script it to give you headshot points, otherwise it would give you headshot points already. So what I'm saying is, don't try this.
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Everything works good now. Thanks to all :)

broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Predicting from what your fx looks like:
In order to move a zombie, you need to spawn and link a tag_origin to the zom. Move the link. Zombies cant be moved themselves
Ok. Can i use the move-part of your WW for my weapon?
broken avatar :(
×
broken avatar :(
Location: deDortmund
Date Registered: 20 December 2015
Last active: 5 months ago
Posts
307
Respect
Forum Rank
Perk Hacker
Primary Group
Community Scripter
My Groups
More
Personal Quote
Payback
×
fanmagic's Groups
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
fanmagic's Contact & Social LinksTears Of The Fallen
Any script of mine ever you have permission to use exactly, or in pieces. ESPECIALLY if you are trying to learn :)
Spoiler: click to open...
even if I felt otherwise I couldnt actually tell you that you cant because all my releases are public. Just remember to credit ;)

I also have code to do what you need that was meant for an upgrade to the atomic levitator. I can send that when I get home. It will be good to learn off of
Ok, sure. Thank you very much, Nate. :)

 
Loading ...