- Yes and no.
- it is
@Liebranca already explained it.
But ok here i added comments
D = objects.worldPosition.z-own.worldPosition.z #calculate vector distance between object and player
if abs(D) <.5: # if +D or -D is smaller then 0.5
SList.append([objects.name,[Store.x,Store.y,Store.z],'Green']) #add this list to Slist
if objects.worldPosition.z>own.worldPosition.z: # if objects z position bigger then player/owner
SList.append([objects.name,[Store.x,Store.y,Store.z],'Red']) #add this list to Slist
else: #if objects z position smaller then or does not exist or throwing error then player/owner
SList.append([objects.name,[Store.x,Store.y,Store.z],'Blue']) #add this list to Slist
Info = eval(Message.bodies)
for Data in Info: #loop trough the information the other script send to here
Added = bge.logic.getCurrentScene().addObject('Token',own,1) #adds the token/icon object
if Data=='Red': #if the send color is red
Added.color = [1,0,0,1]
Added.color = [0,0,1,1]
Added.color = [0,1,0,1]
Added.worldPosition=own.worldPosition+Vector([Data*.1,Data*.1,Data*.1]) # set the token/icon position + the offset data from the lists created in the other script.
It’s a small but rather compact/complex script, for me it’s simple i don’t extend other users scripts.
For you it’s hard because you barely know python. For anyone not into this type of script it’s a pain as well due to the whole script needs to be altered in order to add more/other icons.
Don’t get me wrong it’s a neat lil script, but without knowing python it’s out of your reach (for now).
Aah what the peep. here you go, never say i didn’t help you
ok what to do?
– add your building/landmark
– add 2 properties
– 2. icon_to_use -> string -> name of the icon you going to use.
– go to layer 2
– add an object you going to use as an icon
– give it the exact same name as you used in the ‘icon_to_use’ property of your building/landmark
Tadaa, works great doesn’t it.
problem you have now is it won’t set color depending on height anymore, but with landmarks/buildings it should not be a problem i guess? If it is you figure it out
MiniMapV4_2_adjusted_by_cotaks.blend (606.9 KB)
Have fun with it.
- Oh and check the scripts code from this blend and your blend, i have changed a few things.