Thread: Graal Mode 7
View Single Post
  #24  
Old 08-13-2007, 01:33 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Actually I used 2 dimensions. Doing what you did won't skew the image properly.
You have to alter the x dimensions accordingly. Here is what I used in my script, though it's probably embarrassing math-wise.

PHP Code:
  this.mapsize=screenheight*.75;
  
this.mappos={(screenwidth-screenheight*.75)/2,(screenheight-screenheight*.75)/2};

  
with (findimg(200)) {
    
dimension=2;
    
polygon={
      
thiso.mappos[0]+25,thiso.mappos[1],
      
thiso.mappos[0]+thiso.mapsize-25,thiso.mappos[1],
      
thiso.mappos[0]+thiso.mapsize+150,thiso.mappos[1]+thiso.mapsize,
      
thiso.mappos[0]-150,thiso.mappos[1]+thiso.mapsize
    
};
    
image="map.png";
    
layer=4;
    
mode=1;
    
alpha=.9;
  } 
EDIT: Oh... as far as player detection... I don't advise doing what I did. I suggest learning some trig and scripting a fully 3D polygon and learn how to 'place' something on it. It would be much more versitile.
When doing stuff like putting the player's horizontal position on the map, I use the basic formula (player.x/gmap.width)*mapwidth. What I did for this map is determine the mapwidth depending on the player's position vertically. I use a base mapwidth of the widest part of the map(in this case, the bottom) and subtract ((player.y/gmap.height)*mapheight)*(widestmapwidth-skinniestmapwidth).

If that makes sense. Either way, I don't advise doing it that way. Also, it seems the script doesn't work exactly the way I wanted. The position seems off, but I think it's because of the way Graal maps the image onto the polygon(as you can see in the screenshot, the bottom right is stretched horizontally a lot more than the top-right).

I wanted to do this script using eulerrotation... but it doesn't seem to work and I can't find anyone who knows how to use it.
Reply With Quote