User:Snert: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 22: Line 22:


[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)
==Other potentially useful stuff==
===SA Weather table===
I'm trying to make the timecyc.dat file a lot more readable, mostly for me to be able to make new functions. But I guess it might be useful to scripters as well, if they're for instance intending to use the weather functions to create their own weather system.
[http://dl.dropbox.com/u/4504893/misc/SA%20Weather%20Table.xlsx Download] ('''Note:''' Work-in-progress)


==Function suggestions==
==Function suggestions==
Line 119: Line 127:
setWaterColor
setWaterColor
setRainLevel
setRainLevel
setFogDistance
setFogDistance -- TODO: Rename to setFarClipDistance; timecyc.dat is such a great mess I only noticed this was wrong when I tried to reorganize the darn file


-- We'll need
-- We'll need
setHeatWaveIntensity
setHeatWaveIntensity
setLightningEnabled
setLightningEnabled
setLightOnGround
setSunStuff -- Some stuff concerning the sun in timecyc.dat, gotta see what I can make out of that
setShadowStuff -- Same here
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it
setSandStormEnabled
setSandStormEnabled
-- Some more stuff that might be good to give scripters control of (all from timecyc.dat)
setAmbienceColor -- Sets the color (filter) of objects (or so I assume)
setDirectLightColor -- Sets the color (filter) of vehicles and peds
setSunColor
setSunSize
setSpriteBrightness
setShadowIntensity
setLightShadingValue
setFarClipDistance -- NOTE: Rename setFogDistance to this, as it's more correct (and appears this way in timecyc.dat)
setFogStartDistance
setLightOnGround
setLowerCloudColor -- NOTE: It is assumed that this is the clouds which sort of fly around low, the type of clouds which aren't disabled yet by setCloudsEnabled. Thus, important
setUpperCloudColor
setColorCorrection
-- Prolly the heck of a lot more
-- Prolly the heck of a lot more
</syntaxhighlight>
</syntaxhighlight>
P.S. x86: fix setWeatherBlended, nao


==Memory addresses==
==Memory addresses==
Line 171: Line 190:
| c6 87 d0 4c 8e 00 02
| c6 87 d0 4c 8e 00 02
| mov byte ptr [edi+008e4cd0],02
| mov byte ptr [edi+008e4cd0],02
| Didn't try NOP-ing this function yet
|  
|-
|-
| LS Street lights enabler
| LS Street lights enabler
Line 177: Line 196:
| c6 45 10 03
| c6 45 10 03
| mov byte ptr [ebp+10],03
| mov byte ptr [ebp+10],03
| Didn't try NOP-ing this function yet
|  
|-
|-
| LS Street lights enabler
| LS Street lights enabler
Line 183: Line 202:
| c6 83 d0 4c 8e 00 01
| c6 83 d0 4c 8e 00 01
| mov byte ptr [ebx+008e4cd0],01
| mov byte ptr [ebx+008e4cd0],01
| Didn't try NOP-ing this function yet
|  
|}
|}



Revision as of 09:59, 10 December 2010

Resources

Debug monitor

Resource to easily be able to view server and client debug messages. (remotely)

Created as an example to demonstrate the use of on(Client)DebugMessage.

Images:

 Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png
 Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png

Download (Note: Only works in 1.1 r2091 and later)

Camo vehicles

When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?

Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.

 Camoplane example: http://www.xfire.com/video/3bcb4b/

Download (Note: Only works in 1.1 r2093 and later)

Other potentially useful stuff

SA Weather table

I'm trying to make the timecyc.dat file a lot more readable, mostly for me to be able to make new functions. But I guess it might be useful to scripters as well, if they're for instance intending to use the weather functions to create their own weather system.

Download (Note: Work-in-progress)

Function suggestions

Some functions I should work on sometime soon. (sort of my "TODO")

Server-side

table getAllAccountData ( account theAccount )
bool setAllAccountData ( account theAccount, table theData )

Client-side

-- None at the moment

Both

setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS
getVehicleNitrousRechargeDelay ( vehicle theVehicle )

setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. There seems to be a function for this in the source
areStreetLightsEnabled ( )
areBackgroundGunshotsEnabled ( )
areBirdsEnabled ( )

setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater. Gotta find a way to set it for all peds, not just for the local player
getPedBreath ( ped thePed )

isEventAdded ( string eventName ) -- Should be fairly obvious
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well

Event suggestions

Events which might be quite useful. I should work on these sometime soon.

Server-side

onElementCreate ( ) -- Triggered when an element was created
onVehicleNitrousActivated ( ) -- Should be fairly obvious
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first

Client-side

onClientElementCreate ( ) -- See server-side
onClientVehicleNitrousActivated ( ) -- See server-side
onClientVehicleNitrousDeactivated ( ) -- See server-side
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...

FX functions

Doomed_Space_Marine did research on some particle effects on custom models. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: fxAddBlood) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.

fxAddHeliKillBlood
fxAddCarWashEffect
fxAddCement
fxAddClouds -- Note: It's a rather vague type of effect
fxAddCokeTrail
fxAddShower -- Note: Classed as "some water effect", but unknown what type of water effect. Assuming shower
fxAddSmoke
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though
fxAddLeaves
fxAddSpray
fxAddFireExtinghuiserEffect
fxAddFlamethrowerFlame
fxAddInsects

Weather functions

Warning: This section is for serious weathermen only!

I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.

-- We currently have
setWaveHeight
setSkyGradient
setWindVelocity
setCloudsEnabled
setWaterColor
setRainLevel
setFogDistance -- TODO: Rename to setFarClipDistance; timecyc.dat is such a great mess I only noticed this was wrong when I tried to reorganize the darn file

-- We'll need
setHeatWaveIntensity
setLightningEnabled
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it
setSandStormEnabled

-- Some more stuff that might be good to give scripters control of (all from timecyc.dat)
setAmbienceColor -- Sets the color (filter) of objects (or so I assume)
setDirectLightColor -- Sets the color (filter) of vehicles and peds
setSunColor
setSunSize
setSpriteBrightness
setShadowIntensity
setLightShadingValue
setFarClipDistance -- NOTE: Rename setFogDistance to this, as it's more correct (and appears this way in timecyc.dat)
setFogStartDistance
setLightOnGround
setLowerCloudColor -- NOTE: It is assumed that this is the clouds which sort of fly around low, the type of clouds which aren't disabled yet by setCloudsEnabled. Thus, important
setUpperCloudColor
setColorCorrection

-- Prolly the heck of a lot more

Memory addresses

Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.

Variables

Variables I've discovered through playing around with Cheat Engine

Purpose Address Address type Comments
LS Street lights enabler 0x0960CF4 bool (byte) Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights

Functions

Functions which are setting the above variables. Got these from Cheat Engine as well.

Related to Address Bytes Assembly Comments
LS Street lights enabler 0x0408989 c6 87 d0 4c 8e 00 02 mov byte ptr [edi+008e4cd0],02
LS Street lights enabler 0x040cea3 c6 45 10 03 mov byte ptr [ebp+10],03
LS Street lights enabler 0x040cb71 c6 83 d0 4c 8e 00 01 mov byte ptr [ebx+008e4cd0],01

TODOcument

Functions

getRainLevel ( )
setRainLevel ( float rainLevel )
resetRainLevel ( )

getFogDistance ( )
setFogDistance ( float distance )
resetFogDistance ( )

areInteriorSoundsEnabled ( )
setInteriorSoundsEnabled ( bool enabled )

isElementFrozen ( element theElement ) -- Also mark the functions it replaced as "deprecated"
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course

Element map properties

Vehicle:

- frozen = bool frozen

Ped:

- frozen = bool frozen

Object:

- frozen     = bool frozen
- collisions = bool collisionsEnabled
- scale      = float objectScale