Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
WinHelpers - A Plugin for very much #352504
01/04/11 00:26
01/04/11 00:26
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Hey Guys!
I've created a plugin for gamestudio!
Maybe you think, not another plugin...
But i think my plugin gives you many possibilities to create some code.
Some features of my plugin:
  • Lists
  • Queues
  • Stacks
  • FTP
  • HTTP
  • Registry
  • INI-Files
  • Threading
  • Color conversion
  • Bitmap functions
  • File functions
  • Binary file functions
  • Folder functions
  • Logs
So if you need only one of those functions, please test this plugin.

You can download it here:
DOWNLOAD!

And now some examples, because i did't wrote a documentation yet...

List functions:
Code:
int iList = list_create();
list_add(iList,you);    //Add you to the list
list_add(iList,me);     //Add me to the list
list_remove(iList,you);   //Remove you from list
int iLen = list_length(iList);
int i;
for(i = 0; i < iLen; i++)
{
    ENTITY* ent = list_getitem(iList,i);
    ent.x += 5;
}


You can store every pointer or value in a list.

Registry:
Code:
registry_open(REG_HKEY_LOCAL_MACHINE);

registry_writestring("SOFTWARE\\WinHelper","PlayerName","Felix"));
registry_writevar("SOFTWARE\\WinHelper","PlayerHeight",1.780);
registry_writeint("SOFTWARE\\WinHelper","PlayerAge",17);
registry_writedouble("SOFTWARE\\WinHelper","PlayerWeight",83.2);

STRING* str_buffer = str_create("#1024");
	
registry_readstring(str_buffer,"SOFTWARE\\WinHelper","PlayerAge");
error(str_buffer);



The same with INI-Files
Code:
ini_init();
ini_writestring("data.ini","PlayerInfo","Name","Felix");
ini_writeint("data.ini","PlayerInfo","Age",17);
ini_writevar("data.ini","PlayerInfo","Height",1.780);
ini_writedouble("data.ini,"PlayerInfo","Weight",83.2);

ini_readstring(str_buffer,"data.ini","PlayerInfo","Name");
error(str_buffer);



An example of HTTP:
Code:
net_http_open();
STRING* result = net_http_post("http://www.google.de","",""));
error(result);



New Example with threading functions:
var value = 0;
Code:
function cnt_up(void* data)
{
	while(1)
	{
		value++;
		thread_wait(1);  //Never use the normal wait here!!!!
	}
}

//To call it:
int thread1 = thread_create(cnt_up,NULL);  //Create the thread with no params
wait(-2);
thread_kill(thread1);  //Kill the thread


You have to kill every running thread at the end of your game, because you'll get a crash if not

Hope you get my coding style.
Please requests and bugs in this thread...

Felix

Last edited by Richi007; 01/04/11 12:43. Reason: New example

Visit my site: www.masterq32.de
Re: WinHelpers - A Plugin for very much [Re: MasterQ32] #352511
01/04/11 01:40
01/04/11 01:40
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Nice laugh
One question:
If i can store different type objects within the list, i can store mixed right?

Lets say 2 entities and some vars. In delphi its possible to check for the object type of a pointer.

Is something similar possible in Lite-C?

Like
Code:
if(Pointer Is Entity)//delphi



I created a list object too, and currently iam storing a second parameter to indicate its type.

Greets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: WinHelpers - A Plugin for very much [Re: Rackscha] #352538
01/04/11 11:00
01/04/11 11:00
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
You can use the handle function to determine the type of an object. However, this function only knows engine objects (surprise, surprise), but if I see this right, this is what you wanted.

Btw, do I see this right? You do synchronous networking on the mainthread? If so: Thats fucking evil! DON'T! DNS has a 30 second timeout while TCP has a 75(!) second timeout, not to mention the latency which you also need to keep in mind! Thats way to long for an realtime application!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: WinHelpers - A Plugin for very much [Re: WretchedSid] #352554
01/04/11 12:38
01/04/11 12:38
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline OP
Expert
MasterQ32  Offline OP
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
@Sid:
You don't have to do this in the main thread....
you can create a thread and do your networking stuff there...

I'll add a example of threading to the examples


Visit my site: www.masterq32.de
Re: WinHelpers - A Plugin for very much [Re: MasterQ32] #352559
01/04/11 13:21
01/04/11 13:21
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
But there is a way to do non blocking networking, why the overhead of spawning another thread for this and then fucking up the engine because you are dealing with internal engine structures that are explicitly not thread safe?


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: WinHelpers - A Plugin for very much [Re: WretchedSid] #352562
01/04/11 13:52
01/04/11 13:52
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@Sid: No sadly. Iam dealing with own structures for a GUI system^^"


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1