|
Post by Enzo on Mar 8, 2021 2:56:54 GMT
Is it possible to load a file into runtime programs code, and thus reading the files contents as if they were put directly into IDE, after compile. Contents are 100% JustBasic syntax/commands.
Or
Does a universal format needed to be followed and preprogrammed. (which I know would work)
Trying to make an program that can be edited altered and updated during runtime, via both console input commands and external loaded files.
|
|
|
Post by Rod on Mar 8, 2021 10:05:03 GMT
No, other than running .tkn files. Save yourself a lot of time and trouble. Just load new DATA, not CODE. It is the DATA that shapes and changes the adventure not the CODE. Changing the DATA is easy, changing the CODE is problematic.
|
|
|
Post by honky on Mar 8, 2021 10:08:00 GMT
An example of what you would like to do would be welcome.
|
|
|
Post by Enzo on Mar 8, 2021 10:59:14 GMT
I wanted to make a function set that allows for updating programs universally, without the need for a premptive format and internal library's.
I agree it can be done with data and variablized generic lines of code.
|
|
|
Post by Enzo on Mar 8, 2021 13:26:38 GMT
An example would be adding animations and items after the compile of the rpg game, without using placeholders for 'blank' sprites and animation types.
Code format as the following will need blank sprites and prenamed to load sprite1name1 sprite1name2 {null}-(tostartxy) startx starty endx endy frames splitinterval (2,3,or 4 frames interval which sprite changes images) optionalscale/rotate/ect. propertiesindexkey for item.
I have other uses, but the rpg is an valid example.
|
|
|
Post by Rod on Mar 8, 2021 17:08:11 GMT
Well addsprite and removesprite coupled with a data file would do most of what you want. But the program flow would not change that much and I think that will be a problem for you. I really think you need a whole new program started. Each segment of the adventure could be a .tkn in its own right. So new .tkn = new adventure.
|
|
|
Post by Enzo on Mar 8, 2021 18:14:34 GMT
This is mearly a end-game content type update, for a alternative build that allows for uploading own sprites and information to already made game, supplied by end-user.
With a LAN type hosting setting and if needed some LB .db file access for quicker response (more players), with the intend to give more public exposure for JB LB gaming department, an almost blank verison of the game for others to build off of, as keeping style of a blank engine, just with more features in the spirit of cundos base.
|
|
|
Post by xxgeek on Mar 11, 2021 22:17:33 GMT
The terminology in your post has me not understanding you I believe. If I do understand then this is the answer I have.
Writing to an opened file like the JB IDE running a bas file while it's running would be a no, but would it not be possible to load another bas file with whatever code want changed, have it stay open while the editor is closed, and then restart the editor with the new code from the file created? Maybe with tkn or the renamed jbrun2.exe
Open one file, have it write a new file, and create the tkn etc. On closing it could start the new file to write another file etc etc etc
run jbasic.exe - R newfile.bas (opens the file in JB IDE and runs it) Leaves editor open. run jbasic.exe - T -A newfile.bas (opens the file in JB IDE and creates the tkn, and closes the IDE once saved). One problem to overcome would be "saving" the tkn without user intervention. (save button needs clicked, or carriage return to the opened "save" window, which can be done with 3rd party like Autoit.
Just a thought , and I may be way off the mark. Well worth doing some testing though. This may come in handy for "something"
Anyway, I wanted to run this by all you guys to hear your thoughts regardless if it works for you Enzo.
|
|
|
Post by Enzo on Mar 12, 2021 12:34:24 GMT
More of a real time type operation, an update loop for all information to be changed, can be saved and loaded into and from .txt file, a new program will not update, unless it generates and loads .txt file for automatic update.
A function format is needed to supply generic loops to variables such as if thens, for next, with array variables as data, for items already installed.
If possible, one single function to handle the generic loop, example of animation
info.txt "=,1,3,5000,5001,x,y,bmpname$"
Would add a if then for tracking variable 1 which would be loaded into array, and would display bmpname$ at x,y with pid and id 5000, 5001
function parse$(varstringlen,constantlen,id,pid,x,y,bmpstring$)
if variablestringlen = constant then null=null else for displayloop = variablestringlen to constant mod=mod+1 if mod = variablestringlen then displayEDITHEREimage/animation(x,y,bmpstring$,pid,id,mod) mod=0 else displayEDITHEREimage/animation(x,y,bmpstring$,pid,id,mod) next displayloop end if end if
end function
I wanted to allow users to write code using functions already made in compiled version, which other then unless a complete shell is made, this needs to be itemized.
I.e, loadsprite$(bmpname$,spritename$) 'simple automated, load and preunload of bmp sprite newdrops(npc,itemid) 'assigned npc id and item id to add to array predetermined range allotted for npc Rangearray(n) n=npc*10-10 to n=npc*10+10 mapitems(x,y,questid)'update map() array with item id addnpc(spritename$,x,y,dropsidarraystart,dropidarrayend)'load npc.x(),npc.y() arrays with, spritename$ id quest(x,y,queststring1$,string2$,string3$,tracker,questid,finish) 'adds to array info basic msgs to be displayed, a quest tracker(tracker) array for progress, and quest id for pairing up new tasks, finish determines end of quest by inputting trackervalue to = finish(questid) that is later checked questtask(x,y,queststring$,tracker,questid,rewardId) 'rewardId serves as the new items id, tracker is updated; on tracker hitting if tracker=finish(questid) adds rewardId
These formats contain enough information to release a blank version of the game with having people edit one file and paste working sprites into directory, rather then manually add these I will also be building my game, with this pseudo language, just need to parse the information universally.
Think of each line a command to update blank variables as if it was in the top of the code.
A simple function using a repeating number such as pi or cosine for building the map and placement, use different starts and patterns to modifiy,technically a map could be reproduced from the large random key of possibilities of the different maps), when x,y are left blank, same situation, off repeating key from a generic set.
As you two have suggested one program with multiple, basically unlimited maps, able to be repeated configs, games from the engine. Restart program or copy paste new to run new config file and sprites
|
|