Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-21-2005, 07:54 AM
SSS SSS is offline
Owner of Sceleris
Join Date: Jan 2005
Posts: 14
SSS is on a distinguished road
Having another problem, since Im not good with math.

Here it is, can anyone help?
Im trying to show where the player is on the custom map..
the custom map position is on the screen at
x(screenwidth / 2 - 210)
y(screenheight / 2 - 210)
the map image is shown there, the map image is 420x420
I cant figure the math out same map size as I used for the warping up there....
but it needs to show up using something like this.
showimg 201,@@@Me,this.x+playerx/420,this.y+playery/420;
changeimgvis 201,4;

any math experts out there that can help?
Reply With Quote
  #2  
Old 02-21-2005, 09:43 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally Posted by SSS
Having another problem, since Im not good with math.
[...]
showimg 201,@@@Me,this.x+playerx/420,this.y+playery/420;
changeimgvis 201,4;
Math lesson
We have three numbers, a b c and d (makes more sense for b and c to be vectors and a be a position on b and we are looking for the corresponding position, d, on b, but I doubt you have that kind of math knowledge :/ ) where 0<=a<=b and 0<=d<=c and we want to find d so that a/b = d/c. We work out the expression;
a/b = d/c
(a/b)*c = d
d = (a/b)*c

assuming that this.x and this.y are the map x and y;
we know 420 is the width and height of map image, and 960 is the width and height of the actual map in tiles, therefore using the above expression, a is playerx or y, b = 960, c = 420 and d is the x or y of the position on the map image. You can do the rest, if you can't I will personally beat you with a stick
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #3  
Old 02-24-2005, 07:55 AM
SSS SSS is offline
Owner of Sceleris
Join Date: Jan 2005
Posts: 14
SSS is on a distinguished road
Thanks for helping out, and not being an ******* about it because you have more math skills then me, not all of us have good education, some people just dont understand things the way others do..Everyones different and unique in their own way.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.