I don't entirely understand what you're asking, but I tried my best to answer everything. (I originally was being a big jerk, I apologize ;_; Hopefully this info's more helpful.)
The sully codebase is big, and you're not
meant to read ALL of it. As with any big volume of code, it's usually quite scarring and confusing to look at.
Quote:
Originally posted by aazami
can i pull functions from anywhere in anyfile?
You can pull functions that you declare from any file, by using an #include directive. This is explained in both tutorials and the manual.
Quote:
Originally posted by aazami
is the "callfunction" a preset thing for verge of do i have to create it myself?
Yep,
CallFunction
is a function that is built in to Verge. Its use is sort of advanced. Unless you have a use for it or are required to use it in a library of some sorts, I'd stick with just calling functions directly instead of through
CallFunction
.
Though it's useful! It allows you customize events by switching in other functions at runtime by just switching a string around.
Quote:
Originally posted by aazami
what is with the functions that are like func( variable, " ") qutation marks? what?
It depends, really! Functions can take any sort of parameters you want! Quotations are for strings! (ie. text, names, descriptions for things, other textual things like that).
Your best bet is to either find where the function is declared and see how each parameter is used. Also, check the manual for a list of the builtin functions (which won't be declared anywhere except in verge.exe itself), which is pretty handy. At any rate, each of those variables and strings and numbers in a function call has a use specific to that function.
Quote:
Originally posted by aazami
also how do you write and read from a dat file in verge.
Using the file functions, listed in the manual. You'd use
FileOpen
to open the file, then you'd use a bunch of those crazy
FileRead___
/
FileWrite___
functions. Sully has their own dat formats and stuff for their system.
Really .dat is just a file extension, a dat file could be filled with any sort of information you want to put in a file! If you have a specific dat format you want to be able to read, I can explain how to use it. I don't know too much about Sully's dat files, but I'm sure Grue knows a fair deal.
Quote:
Originally posted by aazami
also in what order do i do things in verge to get things working i mean you have to load files first so that everything can be written on screen?
You can load resources like images/fonts/sprites whenever, you just gotta load them in before you draw them to the screen. You do that by calling
LoadImage
/
LoadFont
/whatever and storing them in a variable before you actually use the resource with a Blit() or PrintString() in a loop.
Quote:
Originally posted by aazami
so i have a set of letters (font.png) how do i get to display each individual letter in that one file in the order i want? just with an img file I saw it is possible, is there a size limit i should know of or take into account when i am coding the display of letters?
I'd probably recommend looking at other working font images. This is the layout of the characters you need to follow. There isn't any size limits on individual characters, just remember to make your individual cells (boxes) in the font all the same size.
This also does a good job of explaining fonts.
Quote:
Originally posted by aazami
so if i type out a string of dialog in notepad coding that it will display in its font and location <-- how do i do that as well.
Fonts are loaded into your game by using
LoadFont
. Printing text onto the screen is done with
PrintString
.
int font = LoadFont("font.png");
PrintString(5, 5, screen, font, "Here be some text!");
Quote:
Originally posted by aazami
is there a way to tell what are the cords are on screen where it will display before i write the code and guess where the img will display? for example 53,24 is at this location and will display on your screen here. what are the end of screen right. left, top, bottom cords?
Sure, 0, 0 is the left top corner, so increasing the x is moving right, increasing y is moving down. The resolution of your game window determines where the bottom-right of the screen are, which you can get by
ImageWidth(screen)
and
ImageHeight(screen)
to figure out where the right bottom corner is.
Quote:
Originally posted by aazami
what is the time % stuff for? i dont get that. where is time declared?
The % sign there is for silly, shortcuts instead of multiple if statements. The % means
modulo, which is the remainder of division. Any expression
x % y
is basically a fancy way of keeping the value "x" between the numbers 0 and y-1, which lets you do funky stuff like wrap the cursor around when you move up at the top of a menu.
timer
is a built in variable, so it's declared inside verge.exe itself, rather than VC files. You can read about builtins in the manual! They use it here to remember the last time a key was pressed, and if it's being held for a while it'll repeat the press (move up again automatically after you hold it down for long enough)
Quote:
Originally posted by aazami
would it be fine to make it like if button is pressed play sound, instead of all this calulation? what is going on here?
Yeah, it is pretty complicated to read to any person starting off, but really it isn't too bad. That function is basically just used to move the cursor when an arrow key's pressed, and it has a thing so the cursor will repeat after so many seconds, hence the timer.
And it does play sounds when you move the cursor, you just need to set it with the Menu1ArrowSetSounds function in the Sully code I guess.
CallFunction(_m1ASnd); //call the sound function defined with Menu1ArrowSetSounds()
The callfunction magic there is to call a function that actually plays the sound effects. _m1ASnd could be a string like "PlayCursorBlip" which is the name of our function PlayCursorBlip which makes sounds or something.
void PlayCursorBlip()
{
PlaySound(sound_blip, 100);
}
Edit: updated to hopefully be more helpful and less of a jerk. Sorry. :(