Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
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 (dr_panther, Ayumi, 1 invisible), 708 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
identify a terrain (*.hmp) #417662
02/15/13 08:33
02/15/13 08:33
Joined: Feb 2009
Posts: 11
R
Racebert69 Offline OP
Newbie
Racebert69  Offline OP
Newbie
R

Joined: Feb 2009
Posts: 11
Hi,

I have a level with 4 terrains (t01.hmp, ..., t04.hmp).
How can I identify a tile with a mouseclick?
Because of memory I do not want to generate *.wmb files.
Any idea for that?
Thanks in advance.

Bert

Re: identify a terrain (*.hmp) [Re: Racebert69] #417668
02/15/13 12:01
02/15/13 12:01
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Give every terrain an own id value in a skill or use http://www.conitec.net/beta/astr_for_entfile.htm

You can get the pointer to the terrain through "mouse_ent".
Then you can use the pointer to get the skill id or the filename.


no science involved
Re: identify a terrain (*.hmp) [Re: fogman] #417671
02/15/13 12:36
02/15/13 12:36
Joined: Feb 2009
Posts: 11
R
Racebert69 Offline OP
Newbie
Racebert69  Offline OP
Newbie
R

Joined: Feb 2009
Posts: 11
Hi Fogman,

wie kann ich einer Terrain-Entity eine ID verpassen?
Bin Jahre raus aus 3dgs, muss mich wieder richtig reinfinden.

Danke

Re: identify a terrain (*.hmp) [Re: Racebert69] #417674
02/15/13 13:00
02/15/13 13:00
Joined: Apr 2005
Posts: 4,506
Germany
F
fogman Offline
Expert
fogman  Offline
Expert
F

Joined: Apr 2005
Posts: 4,506
Germany
Am besten direkt beim erstellen der Terrains:

var vTerrainCounter = 0; // Der Zähler für die id
...


action aTerrain()
{
vTerrainCounter+= 1; // Zähler mit jedem neu erschaffenen Terrain erhöhen
my.skill1 = vTerrainCounter; // id in skill1 speichern
...
...
}

Oder auch so, falls die Terrains keine Action haben:
you = ent_create("deinTerrain.hmp", position, NULL);
vTerrainCounter+= 1;
you.skill1 = vTerrainCounter;


no science involved
Re: identify a terrain (*.hmp) [Re: fogman] #417675
02/15/13 13:08
02/15/13 13:08
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
If the terrains have uniform file names like "t01.hmp", "t02.hmp" and so on, you can first identity if a clicked entity is a terrain via ent_type ( = 4 means it is a terrain). Then, you can use str_for_entfile or the ->type field of the ENTITY-struct to get the filename, e.g. "t01.hmp". If you use str_trunc(str, 4) and str_clip(str, 1), you only have then "01", which you can use together with str_to_int to get the numeric value (= 1).

SOLVED: Re: identify a terrain (*.hmp) [Re: HeelX] #417679
02/15/13 13:36
02/15/13 13:36
Joined: Feb 2009
Posts: 11
R
Racebert69 Offline OP
Newbie
Racebert69  Offline OP
Newbie
R

Joined: Feb 2009
Posts: 11
Super! Hab es über den Skill gelöst.

Fanatstic, I solved it with the entities skill

Thanks alot fogman and HeelX!!!


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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