View Single Post
Jerrythabest Jerrythabest's Avatar

JCF Member

Joined: Apr 2005

Posts: 2,602

Jerrythabest is a forum legendJerrythabest is a forum legendJerrythabest is a forum legend

Feb 7, 2013, 04:30 AM
Jerrythabest is offline
Reply With Quote
Quote:
Originally Posted by Sir Ementaler View Post
I'm pretty sure that JJ2 doesn't contain onTrigger() itself, so to add it, JJ2+ would just have to check for those "too many conditionals every frame" on its own and it wouldn't be any faster. However, it's worth noting that there's no reason this would be slow at all, as all you have to do is check current trigger state (JJ2 array) and previous trigger state (custom array you should update manually) for every trigger. So, check state of two booleans in a for() loop that repeats 32 (or, in your "some day" scenario, 256) times. By my estimation, this won't slow the game down by more than 1.0*10-20 fps. In other words: it's not cumbersome, it gives your script approximately up to 6 more lines, and you shouldn't worry about speed issues, there's no way this would slow the game down.
In fact I think we can do this roughly the same way as with the Text events: when they get activated, we call a specific AngelScript function. That wouldn't require checking all triggers every gametick. This is a planned feature, we just haven't gotten to the point of implementing it.
__________________