Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,631 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Making a Board #416358
01/30/13 15:58
01/30/13 15:58
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
I am attempting to make a board game
I have the pieces moving set 180 quants with each move consistently, but they get less centred with each move.
I'm assuming that the board I threw together in MED is inconsistent, even after using the grid in MED.
Does anyone know a way for me to create a reliable grid in SED so that I can find out if the issue is in my code or my model?
Thanks
rtsgamer706

Re: Making a Board [Re: rtsgamer706] #416360
01/30/13 16:04
01/30/13 16:04
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
First create a quadratic model in med. Then you can use a simple loop like the following one:
Code:
fixed offset = 16; // your block width here
fixed x,y;
for (x = -3; x < 4; x++)
	for (y = -3; y < 4; y++)
		ent_create("yourmodel.mdl",vector(x * offset,y * offset,0),NULL);



Always learn from history, to be sure you make the same mistakes again...
Re: Making a Board [Re: Uhrwerk] #416363
01/30/13 16:08
01/30/13 16:08
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
Thanks that's exactly what I need
how do I find the length and width of the model though?

Re: Making a Board [Re: rtsgamer706] #416366
01/30/13 16:20
01/30/13 16:20
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
You can set it in MED yourself. The model can be dead simple. Four vertices and two faces are sufficient for this purpose. Just move the four vertices to appropriate coordinates.

If you want to find out by code you can create a single temporary entity with the corresponding file, use c_updatehull and then read the value. The width should correspond to ent.max_x - ent.min_x. ent.max_y - ent.min_y should give you the same value if your entity is really quadratic.

http://www.conitec.net/beta/ac_updatehull.htm


Always learn from history, to be sure you make the same mistakes again...
Re: Making a Board [Re: Uhrwerk] #416367
01/30/13 16:38
01/30/13 16:38
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
It's giving me a Syntax error
what else do I need to change beside changing "offset" to the width?

Re: Making a Board [Re: rtsgamer706] #416368
01/30/13 17:12
01/30/13 17:12
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
I forgot the action parameter on ent_create. I corrected the code in my above post.


Always learn from history, to be sure you make the same mistakes again...
Re: Making a Board [Re: Uhrwerk] #416393
01/30/13 22:26
01/30/13 22:26
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
I noticed that before
It seems to be having the issue with this:
Code:
for (y = -3; y < 4 y++)


Re: Making a Board [Re: rtsgamer706] #416394
01/30/13 22:38
01/30/13 22:38
Joined: Jan 2002
Posts: 4,225
Germany / Essen
Uhrwerk Offline
Expert
Uhrwerk  Offline
Expert

Joined: Jan 2002
Posts: 4,225
Germany / Essen
There is a semicolon missing behind the 4 ... come on ...


Always learn from history, to be sure you make the same mistakes again...
Re: Making a Board [Re: Uhrwerk] #416401
01/31/13 02:45
01/31/13 02:45
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
Crap I'm sorry, I thought I checked the loops, apparently I missed that.
Thanks for the help


Gamestudio download | 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