Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Req] Support triggering property changes on entities #311

Closed
Powback opened this issue May 9, 2018 · 6 comments
Closed

[Req] Support triggering property changes on entities #311

Powback opened this issue May 9, 2018 · 6 comments

Comments

@Powback
Copy link

Powback commented May 9, 2018

Similar to how entities have :FireEvent(event), they should also have something like :FireField(field, value).

Example:
image

In this case, we should be able to do something like

ReferenceObjectEntity:FireField('Visible', true)

Reference:
https://github.com/Powback/Venice-EBX/blob/master/Events/Generic/HawkLauncher/Hawk_Mis_01.txt#L80

I'll come back and update the issue with how it works exactly at a later time.

@Powback
Copy link
Author

Powback commented Jul 27, 2018

Looks like we're after "PropertyChanged", as demonstrated here:

http://powback.com/u/735652a2099666ea82e1dcff4ef9bc5c.png
And in fb::LogicVisualEnvironmentEntity::propertyChanged
or fb::ServerStaticModelEntity::propertyChanged

@OrfeasZ
Copy link
Contributor

OrfeasZ commented Jul 27, 2018

You want to trigger property changes or do you want to listen for them? I've already been working on supporting the former. The latter is a bit more complicated.

@Powback
Copy link
Author

Powback commented Jul 27, 2018

Triggering it would be enough for my needs.

@txt231
Copy link

txt231 commented Aug 5, 2018

You need to have a proper FireEvent which supports events like fb::ServerPlayerEvent, fb::ClientPlayerEvent, and possibly more.

An example of an event that needs fb::ServerPlayerEvent is fb::ServerInputRestrictionEntity which might be useful in some vext mods.

@OrfeasZ
Copy link
Contributor

OrfeasZ commented Aug 8, 2018

@txt231 you can open a separate issue for that request.

@OrfeasZ OrfeasZ changed the title [Req] Entity interface - Property, Event, Link [Req] Support triggering property changes on entities Aug 8, 2018
@OrfeasZ
Copy link
Contributor

OrfeasZ commented Aug 19, 2018

Build 13443 adds a PropertyChanged(...) method to trigger property changes on entities. It can be called as follows:

ent:PropertyChanged(1234) -- FNV hash of the event name
ent:PropertyChanged(1234, value) -- see below for details on values
ent:PropertyChanged("SomeProperty")
ent:PropertyChanged("SomeProperty", value)

Currently, only some properties support setting a value of a specific type. Most property listeners that I looked at seem to only do internal changes and not read any values. See the table below for reference.

Property Name Value Type
Transform LinearTransform
ControllableTransform LinearTransform
TransformIn LinearTransform
Enabled bool
Visible bool
BoolValue bool
BoolIn bool
IntValue integer
IntIn integer
FloatValue float
FloatIn float
Vec3In Vec3
Vec4In Vec4
Team TeamId

@OrfeasZ OrfeasZ closed this as completed Aug 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants