Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,481 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Build a building #263980
05/03/09 16:02
05/03/09 16:02
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
I want to move an entity which is a building. When the building is in an other building or in a wall of the map, the building should become red and when there is enough place for it, it should be green (so you can see if you can place it there or not). How can i realise that?

Last edited by Toryno; 05/03/09 16:04.

Thanks for reading, thinking, answering wink
Re: Build a building [Re: Toryno] #264009
05/03/09 19:11
05/03/09 19:11
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
try this:
Code:
c_trace(my.x,my.x,USE_BOX|IGNORE_ME);
if(you != NULL)
{
 ...//make it red
}
else
{
 ...//make it green
}



The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Build a building [Re: Jaxas] #264206
05/05/09 06:05
05/05/09 06:05
Joined: Apr 2009
Posts: 138
Germany
T
Toryno Offline OP
Member
Toryno  Offline OP
Member
T

Joined: Apr 2009
Posts: 138
Germany
Ok nearly perfect wink
But it is green when collididating with the map, how to check this?


Thanks for reading, thinking, answering wink
Re: Build a building [Re: Toryno] #264211
05/05/09 06:59
05/05/09 06:59
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
is map an entity or wmb block level?


3333333333
Re: Build a building [Re: Quad] #264213
05/05/09 07:09
05/05/09 07:09
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
also here's a small project that my sis made at the time i was teaching her lite-c.

you can build diffrent types of buildings by clicking panels, delete them by highlighting them and pressing del key, red/green shows you can build or not, also you can't build in walls and on cliffs. (i mean if one corner of the building doesn't have a ground below, you can't build it, places like edge of a cliff.)

but the code is not optimised(also pretty untidy), there are 2 or more unnecessary c_traces i guess.

f9 toggles debug mode.(you can see where c_traces hit, and the real edges of the model as a square.)

pressing r rotates the building while you are building it.

http://rapidshare.com/files/229324295/StrategyGame.rar

p.s. she's very good at lite-c but not good at English, so she doesn't post in forums. actually my cousin, but i prefer to call her my sis.

edit: fixed link

Last edited by Quadraxas; 05/05/09 07:18.

3333333333
Re: Build a building [Re: Quad] #264232
05/05/09 10:04
05/05/09 10:04
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
c_trace(my.x,my.x,USE_BOX|IGNORE_ME|IGNORE_MAPS);


The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Build a building [Re: Quad] #264234
05/05/09 10:07
05/05/09 10:07
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline
Senior Member
Eagelina  Offline
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Hi Quadraxas !
I did download your sis strategygame.
I did try to run it...
The game runs , but it is almost black. You can barley see the map. And when you select to build, you cant see a thing you are doing.
What do I need to add to the code so I can see what is happening on the screen?

I am using A7 comersial

Last edited by Eagelina; 05/05/09 10:29.

A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Re: Build a building [Re: Eagelina] #264241
05/05/09 10:31
05/05/09 10:31
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
you dont need to add anything, with 7.77 it looks like this when you run the code.c:

(i downloaded from the link to make sure.)
yeah the terrain is a bit dark but it is visible.

you can try to add lights to map, or change the skin/material of the terrain

Last edited by Quadraxas; 05/05/09 10:41.

3333333333
Re: Build a building [Re: Quad] #264250
05/05/09 10:56
05/05/09 10:56
Joined: May 2008
Posts: 331
Lithuania, Vilnius
Jaxas Offline
Senior Member
Jaxas  Offline
Senior Member

Joined: May 2008
Posts: 331
Lithuania, Vilnius
Quadraxas dmeo is realy good, and for Toryno ,you can make it self and create own code wink

Last edited by Jaxas; 05/05/09 12:57.

The smaller the bug, the harder it is to kill.
_________________________________________
Forklift DEMO (3dgs)
Re: Build a building [Re: Jaxas] #264282
05/05/09 12:48
05/05/09 12:48
Joined: Mar 2006
Posts: 321
Norway
Eagelina Offline
Senior Member
Eagelina  Offline
Senior Member

Joined: Mar 2006
Posts: 321
Norway
Yes the demo is okay.

I wanted to se how the code was builded up. Because I love to study code and learn that way.

It is so interesting to see how problems are being solved in so many different ways.


A6 and A7 Commercial
-------------------
Programmer always searching for more to learn and understand. smile
Page 1 of 3 1 2 3

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