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

Unified FlashPaletteEffect and exposed it to Lua #7872

Merged
merged 8 commits into from Jul 5, 2015

Conversation

Mailaender
Copy link
Member

Split from #7863.

@Mailaender Mailaender changed the title add a flash palette and thunder sound effect trait Added a flash palette and thunder sound effect trait Apr 5, 2015
@phrohdoh
Copy link
Member

phrohdoh commented Apr 6, 2015

Shouldn't this subclass the global modifier?

@Mailaender
Copy link
Member Author

Why should it?

{
public readonly string[] ExcludePalettes = { "cursor", "chrome", "colorpicker", "fog", "shroud" };

public readonly float LightningChance = 0.99f;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be 0.01f (or 1, as a percentage -- better if this needs to sync up with gameplay code later) and then change Tick below

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this.
A lower chance value naturally implies the even will (probably) occur less often.

@phrohdoh
Copy link
Member

phrohdoh commented Apr 6, 2015

Because you are just duplicating some logic.
Especially the info property, but perhaps that is not best.

public object Create(ActorInitializer init) { return new Thunder(init, this); }
}

class Thunder : ITick
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thunder is pretty specific when in all actuality you are just playing ambient audio.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This plays an audio whenever the flash palette flashes. See #7871 for regular ambient audio.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, ambient was a bad word on my part, but my point still stands.
Being that this isn't necessarily a thunder sound, it is just a sound played on a condition (which is determined by another trait).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest an alternative then.

@Mailaender
Copy link
Member Author

Shouldn't this subclass the global modifier?
Because you are just duplicating some logic.
Especially the info property, but perhaps that is not best.

Okay, will try that. Then this depends on #7863 now.

@pchote
Copy link
Member

pchote commented Apr 8, 2015

I don't like being the party pooper all the time, but I think that this use case (thunder/lighting) would be much better served by exposing a Lua API to #7863. That would then allow mappers to also do other things such as day/night cycles, turning the weather on/off, or 70's disco mode.

@Mailaender
Copy link
Member Author

When I saw how day/night-cycling is done in Tiberian Sun with triggers that also came to my mind. Traits are a bit simpler to use. We could have both ways to set them up.

@pchote
Copy link
Member

pchote commented Apr 9, 2015

Traits are simple to use, but limited for this purpose. This trait is only really useable for the one or two maps that might want to feature a thunderstorm as a gimmick. The TS ion storm works rather differently.

@Mailaender
Copy link
Member Author

I merged #7871 and #7863 in here as this seems to be the last one of them getting merged though not for technical reasons (GlobalPaletteModifier does not share enough logic to justify sub-classing), but to add a test case (Fort Lonestar) here. All those traits work together to create the atmosphere.

@Mailaender
Copy link
Member Author

Also tried to please the reviewers a bit.

@penev92
Copy link
Member

penev92 commented Apr 25, 2015

I think the lightnings need to be nerfed. Complete white is too much.

@abcdefg30
Copy link
Member

Also needs a rebase.

@Mailaender
Copy link
Member Author

Can you review and merge #7871 first?

@Mailaender
Copy link
Member Author

Rebased and applied the requested changes.

@abcdefg30
Copy link
Member

Needs a rebase again.

@Mailaender
Copy link
Member Author

Rebased and updated.


namespace OpenRA.Mods.Common.Scripting
{
[ScriptGlobal("Palette")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if this reflected the function, not the underlying mechanism. How about "Environment"? We could put all the other (global) ambient sound, weather etc. stuff into that global, too, then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Effect? Nuke flashes aren't really environmental.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to place other palette altering things here for day/night cycles etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Day/night cycles were included in my "etc." :)

I'm just seeing this from a scripter's point of view. Many of those don't know and don't care that you're achieving the effect with modifying a palette, so referring to that in the API makes it less accessible IMO. The API should instead reflect what the scripter actually wants to do, not how it's done behind the scenes.

@obrakmann
Copy link
Contributor

Looks good overall. 👍 once we've decided on a name for the API.

@Mailaender
Copy link
Member Author

Renamed things.

obrakmann added a commit that referenced this pull request Jul 5, 2015
Unified FlashPaletteEffect and exposed it to Lua
@obrakmann obrakmann merged commit c899606 into OpenRA:bleed Jul 5, 2015
@Mailaender Mailaender deleted the storm-effects branch July 5, 2015 19:18
@obrakmann
Copy link
Contributor

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants