Some questions about the scripts.

Smart Kitty

Well-known member
Hi guys, I've been using a lot of scripts in my game since it has very different mechanics than usual, anyway I was wondering if using a lot of inline code could affect the engine in some way? For now everything is going well but does it have or can it have long-term effects?
 
i have been advised to avoid it as much as i can, and use more scripting as @command type, or within spawn_script , onthink , onmove , etc
I dunno who advised you to such thing, but either you got wrong what the person said or the person doesn't know a thing about scripts. Really.

Scripts are like a knife: use it right, and you will have many beneficts; Use it wrong and you will regret that.


Edit: I am stupid and I haven't saw the word "INLINE". Yes, inline scripts aren't a good thing.
 
Last edited:
I dunno who advised you to such thing, but either you got wrong what the person said or the person doesn't know a thing about scripts. Really.

Scripts are like a knife: use it right, and you will have many beneficts; Use it wrong and you will regret that.

That was me who said that, and I'd like to think I know a little something about what I do for a living. :)

Inline scripts ARE best avoided, same as global variables. They aren't bad things as a sinularity, but using either one for stuff you don't have to is poor practice due to a lot of reasons, and will increase resource consumption.

You should always try to write your script into functions and also leverage the events OpenBOR provides you like onmovex, didhit, etc..

DC
 
Haha, calm down guys. Thank you very much for helping me, I have removed and optimized my scripts a bit so as not to force the engine too much. In the same way I appreciate your help, have a good day guys. Thanks :D
 
@O Ilusionista @DCurrent
what is the effect of inline script?
lots of errors? hard to port? (for example to android), bad loading time?
DC posted some details in this post.

One of the big advantages of the @cmd tags over the inline scripts is once you change the main script, all characters that are using the same function will be updated automatically. However, once level files can't use @cmd tags from animation scripts, inline scripts are very useful there.

1683609693485.png

1683609835294.png
 
Back
Top Bottom