Question about controlling screen position

Started by robgw3, June 15, 2014, 08:33:59 PM

Previous topic - Next topic

robgw3

Just curious, is there any way to fix the position of the screen so the player cant scroll the map? Or a way you could hide units? I was thinking of a map that would require one of those two options, sort of like a game of Battleship. You would have a small grid on your side of the map with a larger grid mirroring it. The enemy would have the same. You would place a tower down on your mini grid somewhere, and it would fire a spore at the corresponding location on the enemies grid where it would destroy something if it's there, and do nothing if there isn't. The enemy would do the same to you. It would of course only work if you couldn't see the enemy units though.

planetfall

You can make crpl cores that look like the terrain, then set their Z position so they are in front of the units.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Relli

Or you could make those towers CRPLCores directly, and make them invisible through one of several methods, like setting alpha value to 0. I believe you can fix the screen position too, but I think it requires undocumented CRPL features.
I like this idea of yours, and I'd love to see it completed some day. Best of luck to you.

stewbasic

You can use

EnableAlternateControlMode(TRUE)
EnableNormalZoomControl(FALSE)
SetCameraZoom(0)

to prevent the player from scrolling or zooming out, but the amount of map visible on the screen still depends on the size of the game window. Hiding the units is a much better option, just use a core and set its image to "None" until you're ready to display it.

Flabort

Either SetCameraPosition picks the coordinates of the top left corner of the screen, in which case, use the first script, or else it sets the coords of the middle of the screen, in which case use the second.
0 0 SetCameraPosition

:Awake
TRUE operateWhilePaused
4 SetCameraZoom
FALSE enableNormalZoomControl


MapWidth 2 Div MapHeight 2 Div SetCameraPosition

:Awake
TRUE operateWhilePaused
4 SetCameraZoom
FALSE enableNormalZoomControl


This will freeze the screen to it's position; nothing the player does will be able to move it.
My maps: Top scores: Sugarplum, Cryz Dal, Cryz Torri, Cryz Bohz (Click fetch scores, page courtesy of kwinse)

robgw3

Glad to see some interest in this idea, I haven't actually tried coding anything yet, barely even attempted making my own map. But this idea is something similar to what I have done in javascript. The only problem I see with the idea is translating the selected location to the target location. Not sure exactly how that would work because I figure I can get the coordinates of the selected location by having the player put down a tower or something and getting the location from that, but how to change that to the location for the tower to fire to would require somehow matching up the locations. Like if you place a tower at position 1,1 then it fires to position 101,101 just for example.

Relli

I have absolutely no experience with them personally, but I think you could use lists to bind together the selected and target locations. Maybe two lists that both hold the coordinates of their respective zones, and when you built something on the select zone, it would look for the same "list element" on the other list for the target zone. Hope that helps you out.

robgw3

I know a couple of ways to do it in other programming languages (I'm a beginner programmer), but not sure if they would work in this language. I could do it with an if statement, but that would be a very long list that would get longer the more locations there is.