[Update 1.1.1 - 2015.04.01] Extra Doors CLEO script by nyolc8

Started by nyolc8, August 31, 2014, 12:50

nyolc8

Extra Doors CLEO Script by nyolc8

UPDATE 1.1.1 (2015.04.01)
- fixed a bug which can occur with sliding components

UPDATE 1.1 (2014.09.17)
- slider parts fixed
- parts controlable while driving the car
- when SAMP chat input active, parts will not move. (optional, remove "sampcs_helper.cs" if you want to move parts while chatting)

***

This script creates the possibility to make vehicle models with more controlable parts. You just stand near the vehicle and press the specifc key to control the elements.

script supports 12 moveable parts:
- 2 left sliding object (default key: "I", "Space+I")
- 2 right sliding object (default key: "O", "Space+O")
- 2 left opening door (default key: ",", "Space+,")
- 2 right opening door (default key: ".", "Space+.")
- 2 bonnet-like door (default key: "K", "Space+K")
- 2 boot-like door (default key: "L", "Space+L")

Configuration:
You can change some options in the extra_door.ini file. Check the file for more information.

***

How to create vehicle to support this script:

1. Create a dummy for the specific part
Left Door: "dl_dummy"
Right Door: "dr_dummy"
Bonnet-like Door: "df_dummy"
Boot-like Door: "db_dummy"
Left Slider: "sl_dummy"
Right Slider: "sr_dummy"

To create the second one (which controlled by the "Space+KEY" method) from each, name it like "dl2_dummy". So put a "2" after the first two character.

2. setting the object itself
After you created the dummy, place the object itself into it, and name the object like this scheme:
"cfg_AA.A_BB_C"

AA.A = means float value, so for examle if you want to rotate a door 60 degrees, then specify it like "60.0"
BB = means the animation steps. This value changed the animation speed and smoothness as well. Setting it to "1" causes no animation at all.
C = it can be "1" or "0". This enables sound effect for that specifc part on opening/closing.

So if you want for example an extra openable door, then this is the structure:
+ dl_dummy
>> cfg_60.0_12_1

***

Version 1.1.1:
DOWNLOAD
Mirror

Rubber

Cool. Just out of curiosity, would this work with collisions. Let's say I wanted to add a ramp to the back of a flatbed to be able to drive onto it. Could you rotate both the collision and visual portions down to drive up it?

nyolc8

Quote from: Rubber on August 31, 2014, 15:58
Cool. Just out of curiosity, would this work with collisions. Let's say I wanted to add a ramp to the back of a flatbed to be able to drive onto it. Could you rotate both the collision and visual portions down to drive up it?
I wanted to make it like that. But sadly, I couldn't find any function, or opcodes to move collision like dumper/packer does. I think it's simply not possible with CLEO (or atleast no one found the opcode for it yet).

nyolc8

There will be an update for this script soon with the release of my Stretch mod, there will be two changes:

- slider parts will work properly (bugfix)
- elements will be controlable while driving the car (NEW)

nyolc8

The 1.1 will include also another new feature, it won't register the specific keypresses while you chatting in samp, so you won't open/slide parts while you chatting. (I wish this chat problem fix would be in imvehft too lol)

so 1.1 changelog will be:

- slider parts will work properly (bugfix)
- elements will be controlable while driving the car (NEW)
- keypresses will not processed while chatting in SAMP (NEW)

just a few day testing and I'll release it. (with my new Stretch mod)

nyolc8

#5
I decided to make the samp chat state checking as an extra script for two reasons: it works better with this method, and the other reason is that it can bugged by holding down (or pressing fastly again and again) samp chat activator keys (T or F6) so it will be optional.
So the door script will work with or without this chat checking thingy. You decide if you want to use it.

I could make it better, but then it would require "sampfuncs" cleo plugin too, and that maybe even checked by the server (because that plugin mostly used for cheating in samp), so I decided to make this home-brew solution without the use of that plugin.
If you never hold down (or pressing rapidly) T or F6 key, then it will work nicely.


Looks like I fixed the key holding bug :D

btw this helper script can be used with another future scripts too, to use it for checking the samp chat state :)

nyolc8

UPDATE 1.1 (2014.09.17)
- slider parts fixed
- parts controlable while driving the car
- when SAMP chat input active, parts will not move. (optional, remove "sampcs_helper.cs" if you want to move parts while chatting)

DOWNLOAD
Mirror

nyolc8

UPDATE 1.1.1 (2015.04.01)
- fixed a bug which can occur with sliding components

DOWNLOAD
Mirror