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

Throwable C4 [ V 0.6 ]


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-26-2014 , 13:01   Re: Throwable C4 [ V 0.2 ]
Reply With Quote #11

Quote:
Originally Posted by Arkshine View Post
I think you don't need to reinvent the wheel. You can probably heavily simplify if you're using Orpheu, like using the original function which creates bomb ShootSatchelCharge(), then you won't need all this touch/think/api/and such and let the game handling that (which is better for others plugins compatibility). All left would be probably handling how is thrown bomb. I did not check more than that, so I could be wrong.
I was searching for a way to avoid doing everything manually, to let the game handle it, but I was lazy to go in deep. Thx you, will search( in the sdk and with ida ) and see what can I do.
__________________

Last edited by HamletEagle; 09-26-2014 at 13:02.
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-26-2014 , 13:26   Re: Throwable C4 [ V 0.2 ]
Reply With Quote #12

Just seen ShootSatchelCharge uses Vector as param type ; with Oprheu not going to be possible. With Okapi, I think it's possible with some trick.
__________________
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-26-2014 , 13:37   Re: Throwable C4 [ V 0.2 ]
Reply With Quote #13

Quote:
Originally Posted by Arkshine View Post
Just seen ShootSatchelCharge uses Vector as param type ; with Oprheu not going to be possible. With Okapi, I think it's possible with some trick.
Just tested it and it's working with orpheu perfectly, with just one small problem, origin is not set corectly by the function, I have to do it manually. Will post it when I'm done.
__________________

Last edited by HamletEagle; 09-26-2014 at 13:38.
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-26-2014 , 14:54   Re: Throwable C4 [ V 0.2 ]
Reply With Quote #14

Just because it's called doesn't mean it's working fine ; you might hit some stack issue. But it might be possible if you call only and use float x3. Not sure.
__________________
Arkshine is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-27-2014 , 07:35   Re: Throwable C4 [ V 0.2 ]
Reply With Quote #15

Quote:
Originally Posted by Arkshine View Post
Just because it's called doesn't mean it's working fine ; you might hit some stack issue. But it might be possible if you call only and use float x3. Not sure.
I've updated it and tested for about 2 hours and no erros.
Now:
- Api removed
- Sprites removed
+ The throwed bomb function exactly like the original one from cs: can be defused etc
__________________
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-27-2014 , 08:52   Re: Throwable C4 [ V 0.3 ]
Reply With Quote #16

You should not rush updating, just because you see it somewhow works, doesn't mean it's appropriate to do this. As it has been said, Vector is not really supported by Orpheu, it's a known fact. But Vector class is essentially float x, y, z. So, this could work if you use as types float, float, float, instead of Vector. Did you try?

Also, there is still a lot of unecessary code. If bomb drop/creation is handled by game, why do you still create a custom entity? You should be able to set velocity on it. I did not investigate more than that but it seems you need to carefully review your plugin.
__________________

Last edited by Arkshine; 09-27-2014 at 08:57.
Arkshine is offline
Old 09-27-2014, 09:04
HamletEagle
This message has been deleted by HamletEagle.
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-30-2014 , 15:22   Re: Throwable C4 [ V 0.3 ]
Reply With Quote #17

@Arkshine, when a player press IN_ATTACK2 button, an entity is created and it's throwed, where it lands it will create another entity( the dropped bomb )/ will plant the bomb( if in bomb site ). I don't understand why you consider this useless code, in fact, a lot of approved plugins create another entity when making something dropable, why it would be a problem in my code ? I also tried to get c4 ent id when added to player and then work with it and set velocity, but this fail.

Btw, it worked to make Vector class float float float.
__________________
HamletEagle is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-30-2014 , 16:49   Re: Throwable C4 [ V 0.3 ]
Reply With Quote #18

It's because you don't understand what does the game. I did not try what I have in my mind, but the whole point of your plugin is basically it auto-activates once you drop c4, with some velocity, right?

At first glance, this doesn't seem reasonable to create dummy entity because all this stuff is already handled by the game. You don't do change anything related to c4 itself, just changing drop aim and auto-activating it.

From what you see in CS, you know at some point plant the bomb when you hold primary fire. Why can't you fake that when you drop the bomb? When you deal with gameplay, you should always try the natural way, meaning you deal with CS existing code so you keep game behavior, you keep compatibility with others plugins and you make your plugin more efficient.

My idea is you can probably set some offsets, calling PrimaryAttack on c4, then this would call internally the function which creates the bomb with all associated code around. The tricky part is probably to get the grenade index then you could apply some velocity at this point. It should do what you want, keeping custom code at minimum. It's worth to check. If you don't see how to do, I can give a try.
__________________

Last edited by Arkshine; 09-30-2014 at 16:59.
Arkshine is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 10-01-2014 , 08:02   Re: Throwable C4 [ V 0.3 ]
Reply With Quote #19

i don't if this help but its about c4 anyway:
https://forums.alliedmods.net/showpo...48&postcount=9
__________________
JusTGo is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-01-2014 , 08:32   Re: Throwable C4 [ V 0.3 ]
Reply With Quote #20

Yeah this is similar what you need to do, you set some offsets and pev, then you call primaryattack and this will bypass game check so this calls directly code which plants the bomb.
You need a bit more work to set properly velocity. Ideally, hooking ShootSatchelCharge and altering on the fly origin and velocity.
That's what I wanted HamletEagle figures out. This will simplify a lot the code.
__________________

Last edited by Arkshine; 10-01-2014 at 08:37.
Arkshine 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 13:19.


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