po,
I'll cover 3 OOP concepts and see if this is what you are trying to do:
OOP Concepts
Types
Instantiation
Constructors
You have Types Tminer and Tbase
When you instantiate (create an Object) from the miner Type, you want the x,y coordinates to be the same as the Base where he was created.
one way to do this is to create a special constructor function. With this function you can pass arguments to it (base coordinates) and also include setup info that all miners use (in my example-strength)
call it by:
you can add it to your entitylist however you want (i.e listaddlast)
I'll cover 3 OOP concepts and see if this is what you are trying to do:
OOP Concepts
Types
Instantiation
Constructors
You have Types Tminer and Tbase
When you instantiate (create an Object) from the miner Type, you want the x,y coordinates to be the same as the Base where he was created.
one way to do this is to create a special constructor function. With this function you can pass arguments to it (base coordinates) and also include setup info that all miners use (in my example-strength)
Type TMiner Field x:int Field y:int Field Strength:int ' constructor Function Create:Tminer(basexpos , baseypos) Local temp:Tminer = New Tminer temp.x = basexpos temp.y = baseypos temp.Strength = 100 ' default strength Return temp End Function End Type
call it by:
local newminer:Tminer = Tminer.create(mybase.x , mybase.y)
you can add it to your entitylist however you want (i.e listaddlast)