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

add createPerFrameHandlerObject #441

Merged
merged 6 commits into from
Jul 18, 2016
Merged

add createPerFrameHandlerObject #441

merged 6 commits into from
Jul 18, 2016

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Jul 16, 2016

When merged this pull request will:

  • Reimplements CBA_fnc_createPerFrameHandlerObject (formerly known as cba_common_fnc_addPerFrameHandlerLogic)

Someone in the ACE public chat asked what happened to this. I guess this was meant to be API after all, so now I feel bad for nuking it. Should've been better documented though tbqh.

old one:
https://github.com/sickboy/cba/blob/542e28c71165864a32211a347a72b206d91ef882/addons/common/init_perFrameHandler.sqf#L58

Since this was removed before 2.4 I also took the opportunity to make some tweaks:

  • Use a location instead of an object for minimal overhead.
  • Switched around _args and _delay parameter to make it consistent with addPerFrameHandler
  • The start code now also gets the logic as argument instead of the passed arguments directly. This makes it consistent with all the other called functions.
  • And obviously removed _common_ from the function name.
  • private keyword, pushBack etc. etc.

@commy2 commy2 added the Feature label Jul 16, 2016
@commy2 commy2 added this to the 3.0.1 milestone Jul 16, 2016
@thojkooi
Copy link
Contributor

I think the name addPerFrameHandlerLogic is strange and doesn't properly say what the function does. I'm not sure exactly what a better name should be yet.

@commy2
Copy link
Contributor Author

commy2 commented Jul 16, 2016

createPerFrameHandlerLogic ?

@thojkooi
Copy link
Contributor

thojkooi commented Jul 16, 2016

It's the logic bit that makes it not fit, I think. Though create is indeed better.

@commy2
Copy link
Contributor Author

commy2 commented Jul 16, 2016

Hmm. Other suggestion: createPerFrameHandlerObject. Although Logic is the term for dummy objects that do magical script things in Arma. (e.g. class Logic;)

@commy2 commy2 changed the title addPerFrameHandlerLogic add createPerFrameHandlerLogic Jul 16, 2016
@commy2
Copy link
Contributor Author

commy2 commented Jul 16, 2016

I'm thinking about using these for my port of ACE2 fire propagation.

@thojkooi
Copy link
Contributor

It is, but I see no reason to indicate we use logic objects in the function name. I will think of some suggestions for a better name.

@commy2
Copy link
Contributor Author

commy2 commented Jul 16, 2016

The logic is a fundamental part of this though. It is the return value and the only passed argument in the called functions (aside from the _private functions).

@Killswitch00
Copy link
Contributor

Killswitch00 commented Jul 17, 2016

Object? Entity? Thing? Manager? Agent? (perhaps not, since the concept of "agents" exist in the game).

Executor? Invoker? Worker?

(Logic seems fine though)

@commy2
Copy link
Contributor Author

commy2 commented Jul 17, 2016

Object would perfectly describe the character of this being. But the problem is that the game already has as data type and this is actually a ...

@Killswitch00
Copy link
Contributor

Killswitch00 commented Jul 17, 2016

Runner?
Task?
Job?

@commy2 commy2 mentioned this pull request Jul 17, 2016
1 task
@thojkooi
Copy link
Contributor

Object is the best of those so far. But you could also just leave it out and use createPerFrameHandler.

Logic might be confused with some kind of internal function that handles the per frame handler logic.

@commy2 commy2 changed the title add createPerFrameHandlerLogic add createPerFrameHandlerObject Jul 17, 2016
@Killswitch00
Copy link
Contributor

How about a remote/destroy/delete function as well?

private (_logic getVariable "private");
{ call _x } forEach (_logic getVariable "deserialize");

// check exit condition - exit if false
Copy link
Contributor

Choose a reason for hiding this comment

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

exit if true

@Killswitch00
Copy link
Contributor

Looks about done now.

@Killswitch00 Killswitch00 merged commit decf151 into master Jul 18, 2016
@commy2 commy2 deleted the addPFHLogic branch July 26, 2016 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants