1 registered members (AndrewAMD),
1,481
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Build a building
#263980
05/03/09 16:02
05/03/09 16:02
|
Joined: Apr 2009
Posts: 138 Germany
Toryno
OP
Member
|
OP
Member
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
|
|
|
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
Senior Member
|
Senior Member
Joined: May 2008
Posts: 331
Lithuania, Vilnius
|
try this:
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: Quad]
#264213
05/05/09 07:09
05/05/09 07:09
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
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.rarp.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]
#264234
05/05/09 10:07
05/05/09 10:07
|
Joined: Mar 2006
Posts: 321 Norway
Eagelina
Senior Member
|
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.
|
|
|
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
Senior Expert
|
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
Senior Member
|
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
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
Senior Member
|
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.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|