Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, wandaluciaia, 1 invisible), 798 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: einfacher Techbaum [Re: Aron] #59387
11/21/05 18:51
11/21/05 18:51
Joined: Apr 2004
Posts: 320
TheGameMaker Offline
Senior Member
TheGameMaker  Offline
Senior Member

Joined: Apr 2004
Posts: 320
warum nicht??

Re: einfacher Techbaum [Re: TheGameMaker] #59388
11/21/05 19:12
11/21/05 19:12
Joined: Jun 2002
Posts: 40
Berlin - Deutschland
Aron Offline OP
Newbie
Aron  Offline OP
Newbie

Joined: Jun 2002
Posts: 40
Berlin - Deutschland
I am translating the Script right now.

@TheGameMaker: Weil mich das Spiel genervt hat ... wie soviele Browsergames. Das einzige tolle Browserspiel war "SpacePioneers" bis es kostenpflichtig wurde.

Re: einfacher Techbaum [Re: Aron] #59389
11/21/05 20:00
11/21/05 20:00
Joined: Nov 2002
Posts: 2,148
Germany
Dima Offline
Expert
Dima  Offline
Expert

Joined: Nov 2002
Posts: 2,148
Germany
Sorry for offtopic but ...

Deuterium ist nicht weiter als ein Isotop des Wasserstoffes! Deswegen darf man es verwenden wo man es will, und wie man es will!

Gruß Dima


I'm not afraid of competition cos I'm know that I'm best
Re: einfacher Techbaum [Re: Dima] #59390
11/21/05 20:04
11/21/05 20:04
Joined: Apr 2005
Posts: 1,058
Luzern
Nicolas_B Offline
Serious User
Nicolas_B  Offline
Serious User

Joined: Apr 2005
Posts: 1,058
Luzern
cool danke.
Werds mir merken. Wird sicher mal nützlich sein

Re: einfacher Techbaum [Re: Aron] #59391
11/21/05 20:53
11/21/05 20:53
Joined: Dec 2003
Posts: 988
Germany, Magdeburg
JoGa Offline
User
JoGa  Offline
User

Joined: Dec 2003
Posts: 988
Germany, Magdeburg
Sehr gute Idee! Hatte ähnlichen Einfall, wusste aber nicht, wie man das realisiert.
Hut ab!

Re: einfacher Techbaum [Re: JoGa] #59392
11/21/05 21:08
11/21/05 21:08
Joined: Jun 2002
Posts: 40
Berlin - Deutschland
Aron Offline OP
Newbie
Aron  Offline OP
Newbie

Joined: Jun 2002
Posts: 40
Berlin - Deutschland
This is the first Post of this Topic in english:
Because I needed a script which can handle a techtree for my planned RTS "Planets - Unification" I wrote it myself ^^

It isn't 100% complete... at the moment it is more a InGame Help or something like this.

I wanted to create the script very modular, so i can take it out of my game and place it in any other project without
big changes.

Nevertheless I want to share it with you ( and also the later versions of this script)

Code:
 

/*
* Techtree.wdl - Version 0.2
*
* module for reading ans using techtrees out of a textfile
*
* How to usw techtree.wdl:
* 1. include ( include<techtree.wdl>; )
* 2. set the name of your techtreefile through setTechFilename("DATEINAME") [default:techtree.txt]
* 3. initTechtree("seperator"); to initialize the techtree ( recommended: ";")
* 4. get your information with the get*-functions and process them as you like
*
* example techtree.txt with two lines :
* mining;300;1000;2000;3000;Is needed for:;Oremine,Deuteriumsynthesizer,;crystalmine
* Laser;300;150;1111;3333;Provides your army with;laserweapons and laserguided;missles.
*
* Syntax (after the last Info ENDLINE(Return) instead of semikolon(;)
* name;buildtime;cost_ore;cost_crystal;cost_deuterium;description1;description2;description3
*
* This script can be uses in (non-)commercial projects without credits. Have fun with it !
*
*/

var techtreefile; //Handle for Techtreefile
string techFilename = "techtree.txt"; //Name of the file with the techtreedata

var counter=1; //Linecounter

// declaration of the needed Strings
string techName;
string techCostErz;
string techCostKristall;
string techCostDeuterium;
string techTime;
string techDescription;

function initTechtree(seperator) //only changes the seperator at the moment
{
str_cpy(delimit_str,seperator);
}

function setTechFilename(newname) //here you can change the filename of your techtreefile
{
str_cpy(techfilename,newname);
}

function getTechName(Position) //returns the name of a technology
{
Position = 1+((Position-1)*8);
techtreefile = file_open_read(techFilename);
while(counter<=Position)
{
file_str_read(techtreefile, techName);
counter+=1;
}
file_close(techtreefile);
counter=1;
return(techName);
}

function getTechTime(Position) //returns the building or researchtime for a tech
{
Position = 2+((Position-1)*8);
techtreefile = file_open_read(techFilename);
while(counter<=Position)
{
file_str_read(techtreefile, techTime);
counter+=1;
}
file_close(techtreefile);
counter=1;
return(techTime);
}

// The following 3 functions are returning the needed ammount of ressource (Ore,Crystal,Deuterium) for building or researching
function getTechCostErz(Position)
{
Position = 3+((Position-1)*8);
techtreefile = file_open_read(techFilename);
while(counter<=Position)
{
file_str_read(techtreefile, techCostErz);
counter+=1;
}
file_close(techtreefile);
counter=1;
return(techCostErz);
}

function getTechCostKristall(Position)
{

Position = 4+((Position-1)*8);
techtreefile = file_open_read(techFilename);
while(counter<=Position)
{
file_str_read(techtreefile, techCostKristall);
counter+=1;
}
file_close(techtreefile);
counter=1;
return(techCostKristall);
}

function getTechCostDeuterium(Position)
{
Position = 5+((Position-1)*8);
techtreefile = file_open_read(techFilename);
while(counter<=Position)
{
file_str_read(techtreefile, techCostDeuterium);
counter+=1;
}
file_close(techtreefile);
counter=1;
return(techCostDeuterium);
}


// Gets the Line of the techdescription
function getTechDescription(Position,Line)
{
if((Line>=4)||(Line<=0))
{return ("");
}
else
{
Position = (Line+5)+((Position-1)*8);
techtreefile = file_open_read(techFilename);
while(counter<=Position)
{
file_str_read(techtreefile, techDescription);
counter+=1;
}
file_close(techtreefile);
counter=1;
return(techBeschreibung);
}
}




So I just translated it and I hope I havent overseen a german variable or comment in this script.
I hope you understand my bad english comments ^^
Maybe I won't translate every Version of this script because it costs me a vast ammount of time (I could spend in finishing it).
But every big "release" will be translated.

I didn't test this script after translating it, so if you do please report any bug you found.

Right now I am working on a function which is able to compare the players techlevel with the needed techs
for a technology. This way it becomes a REAL techtreescript.

If there is a newer Version of this script, I will contribute it here.

Critics&Comments are welcome.

Page 2 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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