View Issue Details

IDProjectCategoryView StatusLast Update
0008306Multi Theft Auto : San AndreasClientpublic2014-07-04 04:45
ReporterMaccerAssigned Tosbx320 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version1.4 
Summary0008306: [1.4] Created effects cannot be destroyed or attached.
Description

Some effects that infinitely loop, created using the createEffect function, cannot be destroyed using the destroyElement function.

Likewise, attachElements does not seem to work when trying to attach effects to elements.

Steps To Reproduce
  1. crun local x,y,z=getElementPosition(localPlayer) e=createEffect("petrolcan",x,y,z,0,90,0)

  2. crun destroyElement(e)


  1. crun e=createEffect("petrolcan",0,0,0)

  2. crun attachElements(e,localPlayer,0,0,0,0,90,0)

Additional Information
  1. Consider away of temporarily stopping or pausing looping effects.

  2. Consider adding a way to optionally loop effects that are not already looped (might not be possible without major GTA hacks.)

  3. Consider adding a way to change the effect type, maybe through setElementModel.

TagsNo tags attached.

Activities

sbx320

2014-06-26 07:41

administrator   ~~0021119

Last edited: 2014-06-26 07:42

View 2 revisions

Some effects that infinitely loop, created using the createEffect function, cannot be destroyed using the destroyElement function.
Confirmed. Going to look into that.

Likewise, attachElements does not seem to work when trying to attach effects to elements.
Wasn't implemented yet. Going to do that once I get time.

Consider away of temporarily stopping or pausing looping effects.
Stopping can be done by destroying. Pausing is probably hard to implement.

Consider adding a way to optionally loop effects that are not already looped (might not be possible without major GTA hacks.)
Should be possible to implement with minor GTA hacks. ;)

Consider adding a way to change the effect type, maybe through setElementModel.
setElementModel is for models. I'd rather not change it to accept strings as well. Why would you need to change the type of an effect where you couldn't just recreate it with the new type?

Some more thoughts:
Instead of pausing effects a way to set the timespan for an effect would be interesting. Some effects (e.g. jetpack flames) got multiple "styles" (blue flame vs orange flame) in the same effect. Therefore something like setEffectTimespan(starttime, stoptime) would be nice. I'd imagine that something similar is already implemented in SA.

On a long term scale I'd like to implement support for loading new effects (via an fxp file) as well as replacing SA effects (similar to engineReplaceModel). However this requires me to write a full .fxp format parser, since the SA parser does not handle invalid .fxp files nicely and crashes the game instead. Also I'll need to reverse some more structures for that first.

Currently I'd rather wait with feature additions until 1.4 is no longer trunk for stability reasons. However I'll definitely look into fixing your first bug as soon as I got time.

Thanks for the bug report and the feature suggestions! :)

sbx320

2014-07-04 04:17

administrator   ~~0021236

Last edited: 2014-07-04 04:45

View 3 revisions

Destroying effects is fixed in https://code.google.com/p/mtasa-blue/source/detail?r=6564.

Attaching needs to be solved by scripting. Unlike for CPhysicals (vehicles, objects, players etc.) SA only has a attachment function for ped bones for effects. This function could probably be used for vehicles/objects just fine, but that'd be rather unsafe. For other effects (e.g.: nitro) SA simply moves the effect pre-rendering to the new position.

Edit:
I added a simple useful function for attaching effects to the Wiki
https://wiki.multitheftauto.com/wiki/AttachEffect

Issue History

Date Modified Username Field Change