Calling a functions

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Calling a functions

Post by enric »

I've a doubt (or many :? ), in the BATTLE/SCRIPTS, can a Function in a .BSF be called from a different .BSF?

I see that, for example, in FIRE_AP there is an INCLUDE FIRELOGIC_AP to be able to call functions there.
But, by a mine mistake I called a Function on another .BSF without using the INCLUDE, and it has been working for months !!!

What's the correct way?, and why it works if it should not?
pipfromslitherine
Site Admin
Site Admin
Posts: 9702
Joined: Wed Mar 23, 2005 10:35 pm

Re: Calling a functions

Post by pipfromslitherine »

I would need to see the code and the complete fileset to be sure - it's unlikely that you could call a function that wasn't included in some way in a script.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Calling a functions

Post by enric »

Well, I think the confusion comes from the misunderstanding how scripts are loaded.

If in several ACTIONS.BSF I try to call an external function and I put include "FireLogic_AP.bsf" in them I get the error message.
error.jpg
error.jpg (48.66 KiB) Viewed 2335 times
So I tried to putting the include in $DEFAULT.BSF, and not in each action.BSF, then it works
Post Reply

Return to “Battle Academy 2: Modders Corner”