Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 9,630 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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 | 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