Quantcast

Jump to content

» «
Photo

[SA] Creating 2dfx for your models

10 replies to this topic
DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#1

Posted 23 August 2013 - 05:48 PM Edited by DK22Pac, 03 March 2015 - 10:50 PM.

Tools
RwAnalyze
2dfx tool

General information
2dfx is a section of .dff file in GTA:SA. This section allows attaching special things to models. In San Andreas we have 10 types of 2dfx effects. One of them can be added through .ide files only (furnitur 2dfx), so you couldn't put it into dff (it simply won't work).

2dfx section in RwAnalyze
We can find this section (if it exists) in Clump->Geometry List->Geometry->Extension section.
zugf.png
You can export/import this section by clicking RMB and selecting needed command.
juh1.png
After you exported the section, it will have no extension. Add ".2dfx" extension to the name of the file, so we could use it in 2dfx tool.

2dfx tool
This tool is very simple. It generates .txt file from .2dfx, and .2dfx files from .txt ones.
So, if you want to edit original 2dfx section, you need:
  • export original section to file, add ".2dfx" extension to file's name;
  • put .2dfx file to "2dfx" folder;
  • launch SA2dfx.exe tool;
  • open generated .txt file (it will be placed in same, "2dfx" folder) and edit it;
  • put edited .txt file to "txt" folder;
  • launch SA2dfx.exe tool;
  • get generated .2dfx file from "txt" folder and import it into dff with RwAnalyze.
File structure
Text file starts with number of 2dfx effects in the section.
NumEntries       12
After this, effects are described.
Each effect has its own format, but all of them start with this:
2dfxType         LIGHT
Where "LIGHT" is effect type.
Available types are:
LIGHT
PARTICLE
PED_ATTRACTOR
SUNGLARE
ENEX
ROADSIGN
SLOTMACHINEWHEEL
COVERPOINT
ESCALATOR
After tool will read the effect type, it will select specific format read the information.
LIGHT type
This type is used to create a light. It consists of
  • corona (2d sprite);
  • shadow (projection on a ground);
  • pointlight (dynamic light affects peds & vehicles).
Format of this section:
2dfxType         LIGHT
Position         2.468750 3.131592 4.541241
Color            191 206 132 200
CoronaFarClip    100.000000
PointlightRange  18.000000
CoronaSize       1.000000
ShadowSize       8.000000
CoronaShowMode   DEFAULT
CoronaReflection 0
CoronaFlareType  0
ShadowColorMP    40
ShadowZDistance  0
CoronaTexName    coronastar
ShadowTexName    shad_exp
Flags1           AT_NIGHT
Flags2           -
ViewVector       0 0 100
I think most of parameter don't need additional explanation, we will look into some of them only.
CoronaShowMode
This param is like an additional type of light.
DEFAULT
RANDOM_FLASHING
RANDOM_FLASHIN_ALWAYS_AT_WET_WEATHER
LIGHTS_ANIM_SPEED_4X
LIGHTS_ANIM_SPEED_2X
LIGHTS_ANIM_SPEED_1X
ALWAYS_AT_WET_WEATHER
TRAFFICLIGHT
TRAINCROSSLIGHT
AT_RAIN_ONLY
5S_ON_5S_OFF
6S_ON_4S_OFF
6S_ON_4S_OFF_2
These are known modes. But you can also try unknown (put numbers 0-13 instead of text value).
Flags1
CORONA_CHECK_OBSTACLES
FOG_TYPE1
FOG_TYPE2
WITHOUT_CORONA
CORONA_ONLY_AT_LONG_DISTANCE
AT_DAY
AT_NIGHT
BLINKING1
Flags2
CORONA_ONLY_FROM_BELOW
BLINKING2
UDPDATE_HEIGHT_ABOVE_GROUND
CHECK_DIRECTION
BLINKING3
Using flags
If you want to use few flags, you need to separate them with "," symbol. If you don't want to use any of available flags, you must fill the field with symbol "-".
For example, this
Flags1   AT_DAY,AT_NIGHT
Will make the light is working during hole day.

PARTICLE
Attaching particle effect.
2dfxType         PARTICLE
Position         0.000000 0.000000 0.000000
Name             simplefx
PED_ATTRACTOR
Attracting peds to model's object.
2dfxType         PED_ATTRACTOR
Position         -0.572941 0.661896 0.030715
Type             PED_SEAT_ATTRACTOR
Rotation         -0.993852 0.006778 -0.110507  -0.993852 0.006778 -0.110507  0.995570 -0.009073 0.093582
ExternalScript   -
ExistingProb     75
Unknown1         0
Unknown2         0
Available types of attracting:
PED_ATM_ATTRACTOR
PED_SEAT_ATTRACTOR
PED_PIZZA_ATTRACTOR
PED_PIZZA_ATTRACTOR
PED_SHELTER_ATTRACTOR
PED_TRIGGER_SCRIPT_ATTRACTOR
PED_LOOK_AT_ATTRACTOR
PED_SCRIPTED_ATTRACTOR
PED_PARK_ATTRACTOR
PED_STEP_ATTRACTOR
If using type PED_TRIGGER_SCRIPT_ATTRACTOR, "ExternalScript" field must be filled with script name.

SUNGLARE
Simulating sun flare on a model with creating a corona.
2dfxType         SUNGLARE
Position         0.000000 0.000000 0.000000
ENEX
Attaches an enter-exip teleport to object

ROADSIGN
Attaches road sign text to object
2dfxType         ROADSIGN
Position         1637.679321 -2063.918701 28.069563
Size             5.000000 2.500000
Rotation         48.999981 -90.000008 -90.000015
NumLines         4
SymbolsInLine    16
Color            WHITE
Text1            Bluffs_^_______
Text2            Downtown_^_____
Text3            Mulholland^____
Text4            Vinewood_^_____
Color types
Attaches road sign text to object
WHITE
BLACK
GREEN
RED
SLOTMACHINEWHEEL
Defines slot machine wheel object in casino
2dfxType         SLOTMACHINEWHEEL
Position         0.074211 0.510475 0.921751
WheelIndex       0
COVERPOINT
A place where peds could cover while acting in firefight
2dfxType         COVERPOINT
Position         -0.637695 -12.929321 -4.864481
XY               -0.000001 -1.000000
Type             1
ESCALATOR
Attaches an escalator stairs to object
2dfxType         ESCALATOR
BasePosition     -0.957153 6.627189 -3.237147
BottomPosition   -0.947021 4.526084 -3.237147
TopPosition      -0.980835 -4.370117 3.380810
EndPosition      -0.985107 -6.449219 3.380810
Direction        UP
Direction types
UP
DOWN
  • Blackbird88, olmstead007, LeonTheKiller and 2 others like this

miclin
  • miclin

    old stager

  • Members
  • Joined: 22 Mar 2009
  • Germany

#2

Posted 20 September 2014 - 10:36 PM Edited by miclin, 20 September 2014 - 10:41 PM.

Nice Tool and tutorial, thanks :)

 

I have one problem. I can't get the trafficlights to work.

 

Are they hardcoded to the models? Using the exact same 2dfx section of SA Trafficlights won't work on custom models.   But making a own 2dfx section and replacing the satrafficlight with the custom model, works..


TJGM
  • TJGM

    Boss

  • Members
  • Joined: 14 Jun 2011
  • Ireland
  • Helpfulness Award
    Contribution Award [Mods]

#3

Posted 21 September 2014 - 12:19 AM

Nice Tool and tutorial, thanks :)

 

I have one problem. I can't get the trafficlights to work.

 

Are they hardcoded to the models? Using the exact same 2dfx section of SA Trafficlights won't work on custom models.   But making a own 2dfx section and replacing the satrafficlight with the custom model, works..

I'm pretty sure they're hardcoded.


6Four9
  • 6Four9

    Crackhead

  • Members
  • Joined: 27 Oct 2013
  • Indonesia

#4

Posted 26 March 2015 - 04:59 PM

i has been follow your Tutorial @ZAZ , but why when i adding section it unknown ?

http://gtaforums.com...entry1067197872

 

busted1.png

 

Any one can help me ?

Please fast repply  :) , thank's for Tutorial btw


Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#5

Posted 26 March 2015 - 06:00 PM

Because you are missing some additional stuff that was discovered. Add these to RW_secs.ini under # Miscellaneous: section

0253F2F8=2dfx
0253F200=Atomic Visibility Distance
0253F2FD=Breakable model
0253F201=Clump Visibility Distance
0253F2FE=Frame
0253F2FA=Collision Model
0253F202=Frame Visibility Distance
0253F2FB=GTA HAnim
0253F2FD=Mesh extension
0253F2F9=Night Vertex Colors
0253F2F3=Pipeline set
0253F2FC=Reflection material
0253F2F6=Specular Material
0253F2F5=TexDictionary Link
0253F2F4=Unused 5
0253F2F7=Unused 8
0253F2FF=Unused 16
  • 6Four9 and Concavax like this

6Four9
  • 6Four9

    Crackhead

  • Members
  • Joined: 27 Oct 2013
  • Indonesia

#6

Posted 27 March 2015 - 02:53 AM

 

Because you are missing some additional stuff that was discovered. Add these to RW_secs.ini under # Miscellaneous: section

0253F2F8=2dfx
0253F200=Atomic Visibility Distance
0253F2FD=Breakable model
0253F201=Clump Visibility Distance
0253F2FE=Frame
0253F2FA=Collision Model
0253F202=Frame Visibility Distance
0253F2FB=GTA HAnim
0253F2FD=Mesh extension
0253F2F9=Night Vertex Colors
0253F2F3=Pipeline set
0253F2FC=Reflection material
0253F2F6=Specular Material
0253F2F5=TexDictionary Link
0253F2F4=Unused 5
0253F2F7=Unused 8
0253F2FF=Unused 16

 

Blackbird88 : Thank you Balckbird , i will test it , thank's for info :)

6Four9
  • 6Four9

    Crackhead

  • Members
  • Joined: 27 Oct 2013
  • Indonesia

#7

Posted 27 March 2015 - 03:01 AM

Blackbird or any one , i have one question again :\ , add section has done , but why that name not same :\ ? that is problem or not

at tutorial i saw 2dfx (R*)  but at my RW just 2dfx

 

busted1.png


Blackbird88
  • Blackbird88

    DualShock 3 Buttons EVERYWHERE

  • Members
  • Joined: 21 Jul 2008
  • Czech-Republic

#8

Posted 27 March 2015 - 08:49 AM

It's just a name. It doesn't matter. You can name it whatever you want :)

  • 6Four9 likes this

6Four9
  • 6Four9

    Crackhead

  • Members
  • Joined: 27 Oct 2013
  • Indonesia

#9

Posted 27 March 2015 - 08:55 AM

It's just a name. It doesn't matter. You can name it whatever you want :)

thank's for info :D , it's work :D , now i can add 2dfx feature to my own models :D

thank's for helped :)


DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine
  • Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]

#10

Posted 29 March 2015 - 04:27 PM

The tool was updated (3 weeks ago). Fixed problem with attractors (export), added more examples and a ReadMe file where all flags/constants are listed (most of them also have a description).
  • pep legal and Concavax like this

pep legal
  • pep legal

    Old but Gold

  • Members
  • Joined: 17 May 2008
  • Brazil

#11

Posted 04 April 2015 - 09:10 PM Edited by pep legal, 04 April 2015 - 09:16 PM.

Thanks for this update...I'm playing with that now, but I have a single (and old) question (maybe it's - or it is not - related to this topic) :

 

...inside that "additional stuff that was discovered"  (like Blackbird said) is there any way to dynamically (in game) change texture of a model ? (preferably from a Cleo script)

 

Even by using any 2dfx trick, I need to switch textures of a model acording to time of day (Now I'm switching models - dozens of them. Changing only texture would be more...elegant).

 

Thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users