Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (Konsti, AndrewAMD, 1 invisible), 1,376 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Object building like in a Strategy Game #53119
08/23/05 13:18
08/23/05 13:18
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline OP
Serious User
MichaelGale  Offline OP
Serious User
M

Joined: Aug 2005
Posts: 1,230
Do you wish to build houses in your Strategy-Game? Then this is what you need: Building Script

You can include it very simple to your project. All what you need is a panel or a unit on which you can select what you wish to built. The script is very easy:
If you click on a button on your build panel a function starts, which makes sure that you've enought ressources (wood/stone, you can add more) . Then begins a build mode, in which the selected building follows your mouse, until you click right to place the building.

Games which use something like thath:
Command and Conquer
Warcraft 3

Deutsch:
Wollt ihr Gebäude in eurem Strategie-Spiel bauen? Dann braucht hier das hier:Building Script

Der Script ist leicht in das Projekt einzubinden. Alles was man noch braucht, ist ein Panel oder eine Einheit um auszuwählen, was man bauen will. Der Script funktioniert ganz einfach :
Wenn man auf einen Button in dem Bau-Menü klickt, überprüft eine Funktion ob genüend Ressourcen vorhanden sind. (Holz/Stein, können mehr hinzugefügt werden)Dann beginnt ein Bau-Modus, indem das ausgewählte Gebäude der Maus folgt bis die rechte Maustaste gedrückt wird, dann wir das Gebäude gebaut.

Spiele in denen so etwas vorkommt:
Command and Conquer
Warcraft 3


Your friendly mod is at your service.
Re: Object building like in a Strategy Game [Re: MichaelGale] #53120
08/23/05 21:13
08/23/05 21:13
Joined: Mar 2003
Posts: 556
The Netherlands
scary_man Offline
Developer
scary_man  Offline
Developer

Joined: Mar 2003
Posts: 556
The Netherlands
Looks good so far i think.
What if we want to add more buildings?
not every building costs 200 wood and 50 stones

-Jeroen


Modeller =D
Re: Object building like in a Strategy Game [Re: scary_man] #53121
08/24/05 11:35
08/24/05 11:35
Joined: Apr 2005
Posts: 3,815
Finland
Inestical Offline
Rabbit Developer
Inestical  Offline
Rabbit Developer

Joined: Apr 2005
Posts: 3,815
Finland
aight, red the thread, i find this being nice for such games.
Is this script tiling based, or just giving width and lenght?


"Yesterday was once today's tomorrow."
Re: Object building like in a Strategy Game [Re: Inestical] #53122
08/24/05 12:41
08/24/05 12:41
Joined: Aug 2005
Posts: 1,230
M
MichaelGale Offline OP
Serious User
MichaelGale  Offline OP
Serious User
M

Joined: Aug 2005
Posts: 1,230
First, i think I found a bug:
you've to add :
var build_mode = 0;
to the variables.

Second, you've to create for every building new functions like this:
function check_build_my_own_object1()
{
if(wood >= 1000)
{
...
}
}

function build_my_own_object()
{
what_build = 2; //second object
build_mode = 1;

...

ent_create("my_object.wmb",...
}

Third you've to add this lines to place_object()

if(what_build == 2)
{
ent_CREATE("my_object.wmb",temp,NULL); //place the house
object_placed = 1; //the object is now placed
build_mode = 0; //build-mode inactive

wood -= 1000; //reduces wood
stone -= 500; //reduces stone
}

I hope this help.

PS: I don't understand what you mean with tiling based or something like this.


Your friendly mod is at your service.
Re: Object building like in a Strategy Game [Re: MichaelGale] #53123
08/26/05 23:58
08/26/05 23:58
Joined: Jan 2004
Posts: 295
OptimuS Offline
Member
OptimuS  Offline
Member

Joined: Jan 2004
Posts: 295
He means , in Warcraft III when you click on a building and then start moving the mouse , it snaps to the closest tile ... like you have 4 tiles , you point at the number 1 edge , then the building goes in number 1,you point at number 3 and the building goes in number 3...Warcraft III is a tile based Diablo II too.

Re: Object building like in a Strategy Game [Re: OptimuS] #53124
08/27/05 00:27
08/27/05 00:27
Joined: Jun 2004
Posts: 241
muralist Offline
Member
muralist  Offline
Member

Joined: Jun 2004
Posts: 241
.


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