How can I make specific functions accessible and others not

Started by Hardcoal, November 11, 2019, 15:35:19

Previous topic - Next topic

Hardcoal

Hi. Im getting to the serious parts of this editor im working on.
I have lack of knowledge in many advanced terms.. like modules.. etc..
I have no idea what a Module is. I just use them.

But I have some Idea of what they are.

Anyway.. the point of this post is..
Since Ive added programming to my editor, I want people to get access to my Engine Commands..
So when they open a File for Edit, it will auto complete my commands when typing.

When I open my who project its no problem in blide. it auto complete my commands
but when someone will open only one file he will have no clue what my commands are.

So.. any idea how thats suppose to be done.
Are modules is what im suppose to do?
I have no clue.
Thanks
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

degac

Hi
basically a module is just a 'piece of code' that will be compiled and stored. Everytime a program needs it, BlitzMax simply skip the part of compiling it and link to the other source.

If you open a module like Audio (C:\BlitzMax150\mod\brl.mod\audio.mod\audio.bmx) you will see something like this, where in the REM...END REM block there are some tags to define the command (in this case LoadSound, from the function below).


Rem
bbdoc: Load a sound
returns: A sound object
about:
@url can be either a string, a stream or a #TAudioSample object.
The returned sound can be played using #PlaySound or #CueSound.

The @flags parameter can be any combination of:

[ @{Flag value} | @Effect
* SOUND_LOOP | The sound should loop when played back.
* SOUND_HARDWARE | The sound should be placed in onboard soundcard memory if possible.
]

To combine flags, use the binary 'or' operator: '|'.
End Rem
Function LoadSound:TSound( url:Object,flags=0 )
Return Driver().LoadSound( url,flags )
End Function


So basically you can define what commands the final user should see using REM..END REM blocks just before the function definition.

ie:

Rem
bbdoc: Init engine
returns: nothing
about:
It will initialize the engine, setting up basic world bla bla
End Rem
Function InitEngine:Int()
...
End Function

If there's a problem, there's at least one solution.
www.blitzmax.org

Hardcoal

Ok that's awesome im gonna experiment on that.
Great effort by your side degac thanks
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Brucey

Are they programming "in" your editor, or are they going to be using something like MaxIDE?

Will they be using a scripting language or BlitzMax to interact with your engine APIs?


Hardcoal

It will use anything that Edits Blitzmax Code Like MaxIDE..
I  didnt make my own language or something :)
Btw Xors3D has some internal scripting.. that can be run while the engine is running.
Pretty cool thing..

Im trying to create a comfortable environment for fast game making.
I haven't totally achieved it atm.
Im on a trial and error situation.

I could have managed pretty well using only blueprint if i kept developing it. but the problem is, I  cant make zoom in and out on my blueprint
which makes it very hard to work with.

Coding in my Editor means.. Creating a new blueprint behavior..
so... when you program something that means you can implement it on any object..
so it makes it very worthy.. for you and for others

im slowly fixing and adding matters to my editor to make it workable and worth looking..

Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]