Raised This Month: $32 Target: $400
 8% 

Module: Parachute (not fake)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-06-2012 , 19:05   Module: Parachute (not fake)
Reply With Quote #1

Because too many people asked for this, I've made this little module.

All users in server has parachute, it activates with E (+use) while in air.
It only have one cvar

Quote:
sv_fallspeed (default: 100) // fall speed with parachute.
* Put parachute.wav into sound folder
* Put parachute.mdl into models folder
* Put the module into addons/amxmodx/modules
* Enable adding parachute in addons/amxmodx/configs/modules.ini

I only have linux build. Anyone willing to compile and test under windows will be helpful.
Attached Files
File Type: zip parachute.zip (122.6 KB, 1973 views)
File Type: so parachute_amxx_i386.so (18.1 KB, 1018 views)
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Destro-
Veteran Member
Join Date: Jun 2010
Location: $me->location();
Old 07-06-2012 , 21:12   Re: Module: Parachute (not fake)
Reply With Quote #2

good


window version here
Attached Files
File Type: zip parachute_amxx.zip (60.2 KB, 9784 views)
__________________
Destro- is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 07-07-2012 , 03:28   Re: Module: Parachute (not fake)
Reply With Quote #3

Good job!
__________________
kiki33hun is offline
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 07-07-2012 , 07:47   Re: Module: Parachute (not fake)
Reply With Quote #4

Nice joob joropito !
Can you add 2 natives something likes:
PHP Code:
native set_user_parachute(idbool:bStatus true)
native get_user_parachute(id
and a separate version without parachute sound ?

Also, Arkshine said on this topic using PlayerPreThink for plugin like parachute is not the very good way. Have you idea how to create parachute without PlayerPreThink functions ?
I have tried to make a parachute plugin without PlayerPreThink function, but have a problem with Cache_UnlinkLRU error.
dFF is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-07-2012 , 09:23   Re: Module: Parachute (not fake)
Reply With Quote #5

Quote:
Originally Posted by dFF View Post
Nice joob joropito !
Can you add 2 natives something likes:
PHP Code:
native set_user_parachute(idbool:bStatus true)
native get_user_parachute(id
and a separate version without parachute sound ?

Also, Arkshine said on this topic using PlayerPreThink for plugin like parachute is not the very good way. Have you idea how to create parachute without PlayerPreThink functions ?
I have tried to make a parachute plugin without PlayerPreThink function, but have a problem with Cache_UnlinkLRU error.
It's not really a problem to use PreThink in a module, but i suggested to joropito to rewrite without prethink so he may consider it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-07-2012 , 09:57   Re: Module: Parachute (not fake)
Reply With Quote #6

I have to check if it's smooth to have an entity thinking each 0.1 and adding Z velocity to player. Also I want change the direction to what the player is viewing while flying.

This is just a method copy from the original parachute because lot of people asked to have it in a module. Of course there're some ways to improve this.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 07-07-2012 , 10:51   Re: Module: Parachute (not fake)
Reply With Quote #7

well .. thank you very much joropito, i will buy you a beer.

Last edited by DjOptimuS; 07-07-2012 at 10:51.
DjOptimuS is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-07-2012 , 10:55   Re: Module: Parachute (not fake)
Reply With Quote #8

You can do it without, and using prethink is fairly overkill for that but there are some issues using others ways, that's why I have not released yet the new parachute plugin.

Anyway, except these unexpected problems where I'm working now to figure out some solution, the way I'm using is the following :

- Make the parachute thinking
- Hooking it
- Doing all the stuffs inside with timer.

The purpose is to have a number of actions as less as possible.

To do that, you can optimize things, like :

- Using +use to trigger only the parachute deployment. Meaning hooking ObjectCaps for the deploy only and not like the original where you need to hold +use.
- Using timer to lock the parachute step. Meaning, for example for deploy, the time necessary for the parachute to be fully deployed is > ~2s, so meanwhile this time, the plugin does nothing.
- Creating entity on new player only, unattach/hide it when not used, then delete it when the player is disconnected. No need each time to recreate the entity.
- Letting the engine making the model animation.

You can handle the speed fall differently :

- Method 1 : The smoothest, is to let the engine doing the things, by setting the player's gravity only. It means you will fall like a projectile and where you are going to have a constant acceleration. Such setting is largely enough for small maps or maps where you don't jump high, for example. (Parachute thinking set to 1 second, will explain below why)
- Method 2 : Smooth, using method 1, but to have a better fall approach, you set some basevelocity on z (and not velocity) each 0.1 second. It's good for all kinf of maps.
- Method 3 : Fairly smooth. You set some velocity on z, each 0.1 seconds. It's what does the original parachute plugin, you fall in a straight line in a constant speed. It's good for maps with large high ceiling.

About the method 1, I need to use some delay (1 second) to check if the player is on the ground. I've tried to find a forward which could handle such case, and did not find something useful. But it has the advantage to let some delay before the check, so for example, if you fall on someone or on an edge and you jump or keep falling, the parachute is not closed.

Some issues I have are :

- Some animations problems. It happens randomly. But It might because of my sucking code.
- Because the onground check is done after some time, and because by default the player's gravity is changed, if you jump and you are on the ground, you will make a big jump (because of gravity). A double-edge feature but fixing should not be too hard. (Already done more or less)

All these shits to say, well, parachute can be done in others ways, something way better. The issues should be fixable. But if joropito is on it, I guess no need to bother with my work anymore.
__________________

Last edited by Arkshine; 07-07-2012 at 10:58.
Arkshine is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 07-07-2012 , 13:25   Re: Module: Parachute (not fake)
Reply With Quote #9

What do you mean with (not fake)?
By the way, it would be better to check whether entity exists through FNullEnt instead of getting the entity's index then check it whether is higher than zero.
__________________
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 07-07-2012 , 13:41   Re: Module: Parachute (not fake)
Reply With Quote #10

not fake thing: there was a fake parachute module with slowhack to forward players to some server

FNullEnt: it just check for entity equal to null. I prefer to check for less or equal zero. It's just different opcode, and don't change anything at asm code level.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Reply


Thread Tools
Display Modes

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 19:39.


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