wyn10 Posted December 13, 2011 Share Posted December 13, 2011 No declareplayers in the OSI/RS2 template? Wat. Change to... program New; {$DEFINE RS2} {$DEFINE OSI_Color_Anti_Randoms} {$DEFINE SMART} // Comment out to disable SMART {$I OSI\OSI.scar} const Player_Booleans_Count = 2; Player_Integers_Count = 2; Player_TIA_Count = 1; procedure DeclarePlayer; var I: LongInt; begin SetLength(Players, 1); for I := 0 to High(Players) do begin SetLength(Players[i].Integers, Player_Integers_Count); SetLength(Players[i].Booleans, Player_Booleans_Count); SetLength(Players[i].TIA, Player_TIA_Count); end; with Players[0] do begin Name := ''; Pass := ''; Pin := ''; WorldInfo := [True, -1]; Active := True; end; end; procedure ScriptTerminate; begin FreeOSI; end; begin SetUpOSI; DeclarePlayer; end. Thanks. Quote Link to comment Share on other sites More sharing options...
rsutton Posted December 13, 2011 Share Posted December 13, 2011 As im not too updated with scar scripting as I am with c language programming. I would have to notice though is Longint really right? I know a long in C# and I believe same in c++ is 64 bit which is a bit overkill for the ammount of numbers and the length of such numbers. I think you can use a byte instead, or even a short. which is 8 and 16 signed. Much different if the whole code is written wrong and upgarded to code, this will help processors and people who dont exactly have an updated pc. As I said im not a huge scar scripter as of yet but basic programming knowledge says it is overkill and takes up alot more processing than what is actually needed. So I do hope I dont get flamed by not knowing the value types in pascal available Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 13, 2011 Share Posted December 13, 2011 LongInt is an alias for Integer which is a 32-bit signed int, I'm not much for using LongInt myself, I always use Integer, but it's the same thing. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 13, 2011 Share Posted December 13, 2011 wyn10 I have a better way As im not too updated with scar scripting as I am with c language programming. I would have to notice though is Longint really right? I know a long in C# and I believe same in c++ is 64 bit which is a bit overkill for the ammount of numbers and the length of such numbers.I think you can use a byte instead, or even a short. which is 8 and 16 signed. Much different if the whole code is written wrong and upgarded to code, this will help processors and people who dont exactly have an updated pc. As I said im not a huge scar scripter as of yet but basic programming knowledge says it is overkill and takes up alot more processing than what is actually needed. So I do hope I dont get flamed by not knowing the value types in pascal available Turns out different types are some what sketchy when it comes to stuff like longint, integer, byte, int64. You really have to know what you're doing in SCAR when using them otherwise you run into major problems. I've found it's just best to use integer unless you need int64 and only use longint or byte if you're trying to make an existing type... just to be on the safe side. Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 13, 2011 Share Posted December 13, 2011 wyn10 I have a better way Turns out different types are some what sketchy when it comes to stuff like longint, integer, byte, int64. You really have to know what you're doing in SCAR when using them otherwise you run into major problems. I've found it's just best to use integer unless you need int64 and only use longint or byte if you're trying to make an existing type... just to be on the safe side. Hmm, they're as "sketchy" as in any language, you just have to know how different types behave. Quote Link to comment Share on other sites More sharing options...
rsutton Posted December 13, 2011 Share Posted December 13, 2011 Byte is a really good one to use, if you have a base of short ammount of numbers being presented. Its the fastest way to process. But as you said many people perfer to use int because of the range. You sure in scar that Longint is 32 signed? long is usually 64 signed thats weird. Than again we are talking about pascal now Quote Link to comment Share on other sites More sharing options...
wyn10 Posted December 13, 2011 Author Share Posted December 13, 2011 wyn10 I have a better way Tell then I'll just use this then. Works as it needs too. Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 13, 2011 Share Posted December 13, 2011 Byte is a really good one to use, if you have a base of short ammount of numbers being presented. Its the fastest way to process. But as you said many people perfer to use int because of the range. You sure in scar that Longint is 32 signed? long is usually 64 signed thats weird. Than again we are talking about pascal now http://www.delphibasics.co.uk/RTL.asp?Name=LongInt The article states that LongInt is guaranteed to be a 32-bit Integer in Delphi, however, Integer is always 32-bit. "NativeInt" was added to Delphi as Integer datatype which changes along with the system architecture. Quote Link to comment Share on other sites More sharing options...
rsutton Posted December 13, 2011 Share Posted December 13, 2011 The thing with a program working as it needs to and a program with lifetime stability are two totally different objects to look at. Of course we can write code and make it work. The question after the code is written is, "Is this the best way to go about it?" "Is there any overkill for the processor?" "Is the limetime management the best I can get it" Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 13, 2011 Share Posted December 13, 2011 Hmm, they're as "sketchy" as in any language, you just have to know how different types behave. Yea problem is most people don't know how they behave, or forget. =/ Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 13, 2011 Share Posted December 13, 2011 Yea problem is most people don't know how they behave, or forget. =/ http://www.delphibasics.co.uk/ Most stuff you can use in SCAR is the same as in Delphi. Quote Link to comment Share on other sites More sharing options...
rsutton Posted December 13, 2011 Share Posted December 13, 2011 There we go, as I said I wasnt too keen on how delphi and scar scripting and programming works. everywhere is different to a bit. Anyways After seeing that I think Shortint is your best bet. 8 signed, "The ShortInt type is the smallest form of signed integer, occupying 8 bits (1 byte) of storage. It supports only the integers from -128 to 127. " Unless you need more, this would be the best practice for Application Lifetime Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 13, 2011 Share Posted December 13, 2011 In this case Byte would be a lot more fitting as the value of the field should never be less than 0. Quote Link to comment Share on other sites More sharing options...
rsutton Posted December 13, 2011 Share Posted December 13, 2011 I think the biggest issue with the programming languages of today are that. most languages are the same per say of how types works and the memory and process of each. The type names and how they are referenced are different in just about 100% of every programming language compared to another. I wish the world of programming could just all get along, saying this though we as programmers have a great thing being given to us with .net. Before programming languages were really hard to talk to, framework as such now helps the communication process between each much available together combined. Its in the CCL which is why the framework is one of the best to use now. c,c++,c#,vb,.net,ajax,java so many other languages can now communicate together in a working enviroment. Not saying it is easy to accomplish such as "just throw the code in" but it is. This is why I love the .net framework. Not to mention its future for working together of languages. ---------- Post added at 03:59 AM ---------- Previous post was at 03:58 AM ---------- Didnt see byte in there ya ur right. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 13, 2011 Share Posted December 13, 2011 http://www.delphibasics.co.uk/ Most stuff you can use in SCAR is the same as in Delphi. Most stuff true, but most script users and inexperienced script writers don't know and end up doing stuff with them or use preexisting stuff that is made with the wrong type and something goes horribly wrong. If you are writing some specific method or something and know what you're doing then it's not a problem. But if I started using different types of strings and bytes in OSI wherever possible it would cause mass chaos. Quote Link to comment Share on other sites More sharing options...
FHannes Posted December 13, 2011 Share Posted December 13, 2011 I'm not much a fan of managed languages, though I know plenty of them... However, this is getting a bit offtopic, let's get back to it shall we... Quote Link to comment Share on other sites More sharing options...
wyn10 Posted December 13, 2011 Author Share Posted December 13, 2011 I'm not much a fan of managed languages, though I know plenty of them... However, this is getting a bit offtopic, let's get back to it shall we... Add declare players in template. Nuff said. Import from op or make it. Quote Link to comment Share on other sites More sharing options...
Wanted Posted December 13, 2011 Share Posted December 13, 2011 I'll have a few templates RS2 RS2 Single Player RS2 Multiple Player Problem is multiplayer is more than just a declare players, it's an intricate looping system. Quote Link to comment Share on other sites More sharing options...