Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (92,286 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    4. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Forum Support

    2. Site Suggestions

Sign in to follow this  
DK22Pac

[SA] Creating 2dfx for your models

Recommended Posts

DK22Pac

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:

 

LIGHTPARTICLEPED_ATTRACTORSUNGLAREENEXROADSIGNSLOTMACHINEWHEELCOVERPOINTESCALATOR
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         LIGHTPosition         2.468750 3.131592 4.541241Color            191 206 132 200CoronaFarClip    100.000000PointlightRange  18.000000CoronaSize       1.000000ShadowSize       8.000000CoronaShowMode   DEFAULTCoronaReflection 0CoronaFlareType  0ShadowColorMP    40ShadowZDistance  0CoronaTexName    coronastarShadowTexName    shad_expFlags1           AT_NIGHTFlags2           -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.

 

DEFAULTRANDOM_FLASHINGRANDOM_FLASHIN_ALWAYS_AT_WET_WEATHERLIGHTS_ANIM_SPEED_4XLIGHTS_ANIM_SPEED_2XLIGHTS_ANIM_SPEED_1XALWAYS_AT_WET_WEATHERTRAFFICLIGHTTRAINCROSSLIGHTAT_RAIN_ONLY5S_ON_5S_OFF6S_ON_4S_OFF6S_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_OBSTACLESFOG_TYPE1FOG_TYPE2WITHOUT_CORONACORONA_ONLY_AT_LONG_DISTANCEAT_DAYAT_NIGHTBLINKING1
Flags2

 

CORONA_ONLY_FROM_BELOWBLINKING2UDPDATE_HEIGHT_ABOVE_GROUNDCHECK_DIRECTIONBLINKING3
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         PARTICLEPosition         0.000000 0.000000 0.000000Name             simplefx
PED_ATTRACTOR

Attracting peds to model's object.

 

2dfxType         PED_ATTRACTORPosition         -0.572941 0.661896 0.030715Type             PED_SEAT_ATTRACTORRotation         -0.993852 0.006778 -0.110507  -0.993852 0.006778 -0.110507  0.995570 -0.009073 0.093582ExternalScript   -ExistingProb     75Unknown1         0Unknown2         0
Available types of attracting:

 

PED_ATM_ATTRACTORPED_SEAT_ATTRACTORPED_PIZZA_ATTRACTORPED_PIZZA_ATTRACTORPED_SHELTER_ATTRACTORPED_TRIGGER_SCRIPT_ATTRACTORPED_LOOK_AT_ATTRACTORPED_SCRIPTED_ATTRACTORPED_PARK_ATTRACTORPED_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         SUNGLAREPosition         0.000000 0.000000 0.000000
ENEX

Attaches an enter-exip teleport to object

 

ROADSIGN

Attaches road sign text to object

 

2dfxType         ROADSIGNPosition         1637.679321 -2063.918701 28.069563Size             5.000000 2.500000Rotation         48.999981 -90.000008 -90.000015NumLines         4SymbolsInLine    16Color            WHITEText1            Bluffs_^_______Text2            Downtown_^_____Text3            Mulholland^____Text4            Vinewood_^_____
Color types

Attaches road sign text to object

 

WHITEBLACKGREENRED
SLOTMACHINEWHEEL

Defines slot machine wheel object in casino

 

2dfxType         SLOTMACHINEWHEELPosition         0.074211 0.510475 0.921751WheelIndex       0
COVERPOINT

A place where peds could cover while acting in firefight

 

2dfxType         COVERPOINTPosition         -0.637695 -12.929321 -4.864481XY               -0.000001 -1.000000Type             1
ESCALATOR

Attaches an escalator stairs to object

 

2dfxType         ESCALATORBasePosition     -0.957153 6.627189 -3.237147BottomPosition   -0.947021 4.526084 -3.237147TopPosition      -0.980835 -4.370117 3.380810EndPosition      -0.985107 -6.449219 3.380810Direction        UP
Direction types

 

UPDOWN
Edited by DK22Pac

Share this post


Link to post
Share on other sites
miclin

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..

Edited by miclin

Share this post


Link to post
Share on other sites
TJGM

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.

Share this post


Link to post
Share on other sites
Blackbird88

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

0253F2F8=2dfx0253F200=Atomic Visibility Distance0253F2FD=Breakable model0253F201=Clump Visibility Distance0253F2FE=Frame0253F2FA=Collision Model0253F202=Frame Visibility Distance0253F2FB=GTA HAnim0253F2FD=Mesh extension0253F2F9=Night Vertex Colors0253F2F3=Pipeline set0253F2FC=Reflection material0253F2F6=Specular Material0253F2F5=TexDictionary Link0253F2F4=Unused 50253F2F7=Unused 80253F2FF=Unused 16

Share this post


Link to post
Share on other sites
6Four9

 

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

0253F2F8=2dfx0253F200=Atomic Visibility Distance0253F2FD=Breakable model0253F201=Clump Visibility Distance0253F2FE=Frame0253F2FA=Collision Model0253F202=Frame Visibility Distance0253F2FB=GTA HAnim0253F2FD=Mesh extension0253F2F9=Night Vertex Colors0253F2F3=Pipeline set0253F2FC=Reflection material0253F2F6=Specular Material0253F2F5=TexDictionary Link0253F2F4=Unused 50253F2F7=Unused 80253F2FF=Unused 16

 

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

Share this post


Link to post
Share on other sites
6Four9

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

Share this post


Link to post
Share on other sites
Blackbird88

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

Share this post


Link to post
Share on other sites
6Four9

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 :)

Share this post


Link to post
Share on other sites
DK22Pac

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).

Share this post


Link to post
Share on other sites
pep legal

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.

Edited by pep legal

Share this post


Link to post
Share on other sites
cj2000
PED_ATTRACTOR

Attracting peds to model's object.

 

2dfxType         PED_ATTRACTORPosition         -0.572941 0.661896 0.030715Type             PED_SEAT_ATTRACTORRotation         -0.993852 0.006778 -0.110507  -0.993852 0.006778 -0.110507  0.995570 -0.009073 0.093582ExternalScript   -ExistingProb     75Unknown1         0Unknown2         0

What that Rotation should represent? The rotation matrix or euler angles?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.