00:00
00:00
MSGhero
Free time is nice time.

Nick @MSGhero

Age 30, Male

Somewhere in the North

Joined on 12/15/10

Level:
17
Exp Points:
2,848 / 3,210
Exp Rank:
19,904
Vote Power:
5.85 votes
Rank:
Police Sergeant
Global Rank:
6,518
Blams:
456
Saves:
937
B/P Bonus:
12%
Whistle:
Normal
Trophies:
6
Medals:
661
Supporter:
11y 5m 6d
Gear:
3

Comments

Why have you got the event payload in the name of the event? Just have a nice lovely typed object for it?

Are they literally magic strings or are you using constants? Otherwise later I guarantee you'll forget what strings you've made up :)

The excluding bit seems a tad bonkers to me. The problem lies deeper I think. If there is a different outcome for the first time you enter then perhaps it should be a different event. If that isn't what you want then I suppose some sort of internal reasoning within the listener could be okay, but it will be a little bit difficult to keep track of the state with so many "local" decisions being made.

The event prefixes are constants, the suffixes are mainly numbers that I have to write out. I have the event data there because a lot of the commands are strings coming from a json cutscene object. They get parsed into the prefix and suffix that get sent out.

Maybe for entering a city I could use a different event the second time, but talking to an NPC who says the same thing each time, it would be weird to see two events.

I admire the fact that you've created an elaborate string event system to encode your events but I can't help but wonder why you didn't use objects. Having a closed system like an enum for the event cases seems more natural to me because it's less open to ambiguation.
I mean if you have to parse the event string anyway why not use a typed object in the first place?

It can be a matter of performance, but events that don't fire thousands of times every second don't seem prone to this performance boost to me. Maybe you just really dislike flash’s native event flow.

Json cutscenes have commands written as strings, and it seemed more natural to parse the string than to make an object out of it. I could have used events, and I do use events in some areas (the areas I made before this...). There's a decent chance PSvils said something that made me not use events too :P