Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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