tzoli wrote:Multi-language:(Hungraian text gets cut off) I don't see it somehow.It's too early for me xD
Could you send a picture?
Btw the problem is that that the word is Út(not big difference but longer pronunciation), but GE doesn't really support that as I see
Info Tool:
Well the road range will raise for two squares.
The 7 squares will be funny but I will do it.
btw: The one square searches for the -1 -1, 0 -1, 1 -1 etc. coordinates(from the tile that uses it) the two squares calls for the one sqare search if that fails then search for the -2 -2,-1 -2,0 -2 etc. While I do it for 7 I will be as old as Beethoven is now
. Anyways I have to do it.
Roads: I know... Is there a rotate function in GE which wouldn't ruin my map system?
Ports: Good Idea
Map Editor: I wasn't working on this yet but ok. I won't finish it
MAP EDITOR Oh sorry, those terrain graphics were the ones for the map editor, so no need to stop (I forgot to edit the post before posting)
TEXT CUT-OFF BUGAh, it only happens when I click the TAX option on right and font gets large. Here's a screenshot:
ROTATING ACTORSThere is no rotate functionality in gE (only in 1.5 beta version). The only way is via animations or loading in .bmp images into canvass and manipulating it (I don't know how to yet). There's something on the forums about it.
LOCATING SOMETHING WITHIN A RANGEThere is a 'struct' and 'bitewise operator' method that is very cool for simultaneously finding upto 32 things in a range but I'm still experimenting with it.
However, there is an easier way if you know the position you can find the boundary of its range and calculate whether an object lines inside it (NOT for stuff like roads, water pipes, powerlines just other structures).
Take a Park for example. Say it's range is 3. For your tile size of 32px this is 3 * 32 = 96 but for range finding you have to look for distances from centre of one actor to other (because gE by default uses top-left corner as start of it's position 0,0 which makes for more work).
Here's an illustration:-
Here's a quick test code for a demo you can do.
1. GLOBAL CODE (add as globalVars in global code editor)
- Code: Select all
# define TILE_SIZE 32
2. Create 'townHall' and 'house' normal actors, both 32px x 32px with whatever animation image
3. create A global function that checks if searchActor (e.g. house) is within the findActor's (e.g. townHall) range.
returns an integer 0 if not found and 1 if is avilable with in range.
- Code: Select all
int isAvailable (Actor * findActor, Actor * searchActor, int findRange )
{
int found = 0; // 0 = not found, 1 = found
//calculate range limits of findActor from its centre using findRange
int theRange = findRange * TILE_SIZE;
int minX = (findActor->x+TILE_SIZE/2)-theRange;
int maxX = (findActor->x+TILE_SIZE/2)+theRange;
int minY = (findActor->y+TILE_SIZE/2)-theRange;
int maxY = (findActor->y+TILE_SIZE/2)+theRange;
//Calculate centre of searchActor
int CenX = searchActor->x+(searchActor->width/2);
int CenY = searchActor->y+(searchActor->height/2);
// Check if searchActor within findActors range
found = ((CenX>=minX)&&(CenX<=maxX)&&(CenY>=minY)&&(CenY<=maxY));
return found;
}
4. create a text actor 'txtResult' to show return value of
isAvailable function.
5. create a drag event for 'townHall' & 'house' actors in MOUSE RIGHT CLICK EVENT so you can test for different positions of each.
(
Actor Control->Add->Mouse Button Down->enable right & drag->add action->script )
- Code: Select all
//townHall->mouse button down (right)
// drag enabled
//house->mouse button down (right)
// drag enabled
6. create a MOUSE LEFT CLICK EVENT to call
isAvailable and show result in above text actor.
- Code: Select all
//house->mouse button down (left)
int result = 0; // use this to store return value from function
result=isAvailable (&townHall, &house, 5);
sprintf(txtResult.text,"Town Hall is available = %i",result);
demo instructions Just drag-move house and townHall around with right mouse click amd
left mouse click house to see result. You'll notice that you can now have any range size you want even 100 if you want (e.g. TILE_SIZE * 100 = 32 x 100 =3200px in either direction ). Note that it is accurate to within 1 pixel so if your a pixel out of range it will show output as zero. I recommend you play around with my demo code and adopt it for your clones, if you want.
Here's .ged for above demo:
AREA OF RANGE You can even do simple neat stuff like get the area of the range. See illustration below:-
Since range is a square bound box, Area of range (excluding central building) = (pow((2*Range)+1)),2)-1.
2*Range because its for both sides of central building, +1 to include central tile for total area calculation and -1 to exclude central tile from final area (since your interested in surrounding area exclusive of the central tile).
This is usefull because you can find the maximum population a service can handle. Say a house can have a maximum of 6 people. Than a range of 2 has an area of (((2*2)+1)*((2*2)+1))-1= 5*5-1=25-1 =24 squares which is 24 houses that can contain a maximum of 24 * 6 people = 144. In other words this particular range can handle 144 people based on a house of 6 peeps max per home. If the range is of a school but the school can only have a max of 100 students then the school is overcrowded by an extra 44 students and it's education rating would be lowered accordingly (because over-stressed by supply of students). You could apply the same principle for others (hospital health capacity, water, power, so on...).
Examples:-
Hospital message: this hospital does not have enough doctors, please reconsider health funding.
Power Station message: This station has exceeded it's power capacity, build another powerstation or upgrade an exisiting one.
School kid message: This city is boring, theres no parks for me to play in with my friends.
... and so on for other facilities.
Another stuff you can do is find if a range contains a group of buildings for the area to attract more affluent population with more wealth and you can tax them higher but the pay-off is that they will demand more stuff all the time.
Abandoned buildingsHave you considered that if a household is dissatisfied they are likely to abandon the house and move out of city? In which case you will need to show this visually with an abandoned building graphic on map in addition to a drop in population. Something rubbish like this for now (but something much better for final version though):-
- AbandonedBuilding.png (918 Bytes) Viewed 4562 times
Good luck