Log in

View Full Version : includes? (my own) lol?



Ouivile
07-21-2009, 03:51 PM
so im making (Attempting at the least - which IS something so blow me haters) a script for outside rs2 (3 now?) needs. because i like scar and the idea of scar and its almost like a puzzle for me to see what i can do with it...anyway. so can someone explain how to make my own includes, of course you would need to know what i know soooo this is what happend so far:

i have looked thru the srl includes in structure of file location and the actual script (which it is organized yet remarkably confusing.) i tried to make do with what i could figure out. but that ended up being almost nothing. (on the conscious level at least).

heres kinda what i need:

i need a way to use procedures as functions. i use the main pre-given scar functions because they are faster, simpler, and i have no need for antiban stuff. ok i know i can use procedures as functions in a main loop, but that kinda doesnt work because i somtimes need to use procedures within procedures which wont work. hence i need them to be functions?!?!???? idk...
also. even then i reuse the procedures in other scripts. however. it takes up space and resources to have to copy and paste the functions into every script. that is why i need to make includes. it would be so much easier! i duno how though.

can someone give me an example (plz waaayyy simpler than srl) of how to make a function and include and etc ^^^^^^^.

i also realize as ive been told i do not make sense sometimes. so if i confused you, let me know il try to re explain.

also ironically i cant give you guys what im working with because it does not yet exist haha. well....it used to. i just delteted it. and now im going to remake it. much better cuz hopefully now ill use my own functions and includes.

thanks srl. which i hope to be part of and help some people out in return.

Da 0wner
07-21-2009, 04:03 PM
Well you make a script with the functions and procedures that you want to be in the include in it. Just forget the main loop. Then place the file into /Includes/ of the SCAR folder. Then you just put {.include Filename.scar} at the top of the script you want to use the include with.

mixster
07-21-2009, 04:07 PM
All an include is is a Scar file with no main loop. You then save it - usually in the core Scar folder (so C:\Program Files\SCAR3.15\ or something similar) then includes. After that, at the top of the script, you just have the same line you would have for SRL, but instead have your file instead of SRL/SRL.scar, so something like

program MyScript;
{.include MyInclude.scar}
// Rest of script goes here


Then your include file is just full of the functions and procedures you want to use.
SRL only has multiple files because it is pretty massive - for a smaller include just one file is fine :)

About the procedure and function stuff, I have no idea what you're talking about. They are two different things, but only in that a function returns a value. You can have a function that calls a procedure inside it and vice versa as well as having a procedure that calls a procedure inside of it and same with functions. If this is not what you meant, can you explain it a bit more or if it is right and you're still not getting it, I can make a little script to show you what I mean by it

Da 0wner
07-21-2009, 04:10 PM
Yeah I would have explained it more clearly, but I am typing on my iPod :p.

Daniel
07-21-2009, 07:00 PM
Checkout my tutorial (link is in the signature), made explicitly for what you need to do ;)

Ouivile
07-22-2009, 10:16 AM
Thanks everyone for trying to help. what you guys told me was common sense stuff which i got out myself by looking thru the srl includes. but thanks anyways. i guess i want too clear. however im looking thru dans tuts (THANKKS DAN) and thereyre so well made im looking thru the ones i dont even need haha.

yes that is partially what i needed to know however not all of my problems are solved yet. im not going to try to explain my previous post ATM because with this new aquired knowledge i want to try to figure it out myself for a day or two first. If i get stuck I'll be sure to come back for some help.

THANKS ALL
~Oui