Announcement

Collapse
No announcement yet.

MultiSketchMapInfo - For multiple floors and side views

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MultiSketchMapInfo - For multiple floors and side views

    Create new actor called MultiSketchMapInfo under ThieverySketchMapInfo and paste this code into it:

    [Necro-Edit: WARNING! This code won't work online]
    Code:
    //=============================================================================
    // MultiSketchMapInfo. 
    //	
    //  based on and extends ThieverySketchMapInfo
    //  by DeepQantas - 2004
    //	
    //	In order to use this SketchMapInfo, first set it up like you would a
    //	normal ThieverySketchMapInfo. You don't have to set coordinates under
    //	the normal properties, but the default zone will use them.
    //	
    //	To use alternative zone coordinates, do the following:
    //		- Put "XXX" in the Tag property of the ZoneInfo(s) you want to use the
    //			alternative coordinates for.
    //		- Under MultiSketchMapInfo properties, put "XXX" into the first
    //			AltZoneTag field.
    //		- Fill in the coordinates for first AltMapTopLeft and AltMapBottomRight
    //		- Repeat...
    //		- Warning! Don't leave empty AltZoneTags in the middle of the list. The
    //			script will think the rest of that list is empty if you do.
    //	
    //	In order to make one or more of the zones to use alternative axises,
    //	for example if you're creating a tower and want a side-view, do this:
    //	
    //		- Set the AltMapAxis to Axis_XZ or Axis_YZ
    //		- Set the X or Y coordinates (whichever you're using) normally in
    //			AltMapTopLeft and AltMapBottomRight.
    //		- Put the proper Z-coordinates into AltMapTopLeft and AltMapBottomRight
    //		- Warning! Here's the logical inconsistency. Even though it's called
    //			"TopLeft" you must put the smaller Z-coordinate into AltMapTopLeft.
    //			Likewise put the greater Z-coordinate into AltMapBottomRight.
    //	
    //=============================================================================
    class MultiSketchMapInfo expands ThieverySketchMapInfo;
    
    enum Axis 
    	{
    	Axis_TopDown,
    	Axis_XZ,
    	Axis_YZ
    	};
    
    var() name AltZoneTag[10];
    
    var() vector AltMapTopLeft[10];
    var() vector AltMapBottomRight[10];
    
    var() Axis AltMapAxis[10];
    
    var int AltMapCount;
    
    //var zoneinfo Zone;
    
    function PostBeginPlay()
    	{
    	local int i;
    	
    	super.PostBeginPlay();
    	
    	AltMapCount=0;
    	
    	for (i=0; i<10; i++)
    		{
    		if (AltZoneTag[i]=='')
    			{
    			break;
    			}
    		else
    			{
    			log ("MultiSketchMapInfo - Alternative Zone Tag: " $ AltZoneTag[i]);
    			AltMapCount=i+1;
    			}
    		}
    	}
    
    
    
    simulated function bool LocationToPixel(vector L, Canvas C, out float cx, out float cy) {
    	local float xrange, yrange, xx, yy;
    	local vector TopLeft, BottomRight;
    	local int i;
    	local Axis ax;
    	
    	// check a map with player locations shown exists
    	if (!bShowPlayerLocation)
    		return false;
    
    	TopLeft=MapTopLeft;
    	BottomRight=MapBottomRight;
    	ax=Axis_TopDown;
    
    	// Move this actor so we can check the zone of the location
    	
    	SetLocation(L);
    	
    	for (i=0; i<AltMapCount; i++)
    		{
    		if (self.Region.Zone.Tag==AltZoneTag[i])
    			{
    			TopLeft=AltMapTopLeft[i];
    			BottomRight=AltMapBottomRight[i];
    			ax=AltMapAxis[i];
    			
    			break;
    			}
    		}
    	
    	
    	// check player is inside the bounds of the map
    	if (ax==Axis_TopDown || ax==Axis_XZ) if (L.X < TopLeft.X || L.X > BottomRight.X) return false;
    	if (ax==Axis_TopDown || ax==Axis_YZ) if (L.Y < TopLeft.Y || L.Y > BottomRight.Y) return false;
    	if (ax==Axis_XZ || ax==Axis_YZ) if (L.Z < TopLeft.Z || L.Z > BottomRight.Z) return false;
    
    
    	  // calculate canvas coords
    
    	if (ax==Axis_TopDown)
    		{
    		xrange=( BottomRight.X - TopLeft.X );
    		yrange=( BottomRight.Y - TopLeft.Y );
    		
    		cx=( ( L.X - TopLeft.X ) / xrange ) * C.ClipX;
    		cy=( ( L.Y - TopLeft.Y ) / yrange ) * C.ClipY;
    		}
    	else if (ax==Axis_XZ)
    		{
    		xrange=( BottomRight.X - TopLeft.X );
    		yrange=( BottomRight.Z - TopLeft.Z );
    		
    		cx=( ( L.X - TopLeft.X ) / xrange ) * C.ClipX;
    		cy=C.ClipY - ( ( L.Z - TopLeft.Z ) / yrange ) * C.ClipY;
    		}
    	else
    		{
    		xrange=( BottomRight.Y - TopLeft.Y );
    		yrange=( BottomRight.Z - TopLeft.Z );
    		
    		cx=( ( L.Y - TopLeft.Y ) / xrange ) * C.ClipX;
    		cy=C.ClipY - ( ( L.Z - TopLeft.Z ) / yrange ) * C.ClipY;
    		}
    
    	return true;
    }

    Feedback welcome... Especially if it's not working.
    Last edited by DeepQantas; 28 Nov 2004, 03:48 PM.
    Ah, to be a hero. Keeping such company...

  • #2
    coooooooooooooooooool :grin: just what I need for my map , Dalai had said we'd get them all the way back for 1.2 so it's good that someones released one 8) it might also mean some other peoples maps which have been in production for years may get finished.

    Now a request- can you make a script to increase the fps on my maps :grin:

    n1 DQ
    [E.D.G] "Eaves Droppers Guild - we're on the edge."

    All New Thievery-O's!

    Comment


    • #3
      Nice work- will have to give this a try. Making a level with storng vertical component to it. Top view would not do, but a side view might actually be useful.

      Will this be included in 1.5?
      Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
      Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

      Comment


      • #4
        Works fine- was able to get it to function.

        Anyway to make an alternative view the default map? Tried using the level tag "LevelInfo" but this did not work for me.

        Unclear concerning how he multiple map feature is supposed to function. Are the different alternative zones supposed to be visible simulataneouslly? whn you move from zone to zone? other?

        Thanks again.
        Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
        Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

        Comment


        • #5
          Yeah. It's like... uhh.

          Let's suppose you got this mansion which has two floors. You have also drawn a sketchmap that shows the two floors side by side.

          1st floor has a ZoneInfo with a tag "Bottom"
          2nd floor has ZoneInfo with tag "Top"

          Then, in that MultiSketchMapInfo object, you set the AltZoneTag[0] to "Bottom" and AltZoneTag[1] to "Top".

          Then you set the coordinates to AltMapTopLefts and AltMapBottomRights. Of course there's no easy way to do it. Just like with normal SketchMapInfo, your best bet probably is to start the game as a guard, place the Supply Chest in the South-East corner and yourself in North-West corner of the floor. Then open up the MultiSketchMapInfo's properties with the console command "EditActor class=MultiSketchMapInfo" and edit the coordinates on the fly until you and the chest are situated correctly on the sketchmap. (Remember to write the values down).

          If you get it working, it should work so that whenever someone from the first floor goes up the stairs, he disappears from the first floor and appears on the second floor. So yeah... The floors are shown at the same time.

          As for whether this will be in 1.5... Uhm. I suppose that'd be just a matter of putting it in some package. No idea. I'll ask around. But I suppose it won't hurt if you use it in MyLevel for now.
          Ah, to be a hero. Keeping such company...

          Comment


          • #6
            I have been working on map that makes use of the MulitSketchMapInfo actor. At the moment, I have a side view working, and would like to add a front view. Problem is it seems a zone can only be used for one view, and one view only. As set up now, if someone in zone 1, which is used by the YZ plane (side view), they will appear in the YZ view. However, if zone 1 is also used for the XZ plane (front view), that player will not be seen in that view. Any ideas on how to work around this??

            The map has a strong vertical component to it. A top down map would not be very useful unless split into six or seven different views. Do not want to do this because a) I am lazy and b) think it would be too cluttered. The side view alone should be sufficient, but a front view would be make it all the more useful.
            Give some taffer fire, and you'll keep him warm for the night with one less reason to cause trouble for the master.
            Set a taffer on fire, and he will be warm for the rest of his life, and have no need to bother the master.

            Comment


            • #7
              Why not go for a 3D map then? Just make a small-scale siplified model replica, and... oh right, you're lazy
              ]V[]V[

              Comment


              • #8
                This will be in 1.5, since I use it in Th-Airship
                Very nice bit of coding DQ
                Mordengaard - Tester/Mapper/Voice Actor/Nitpick/Coder

                "Criminal: A person with predatory instincts who has not sufficient capital to form a corporation."
                :: Howard Scott

                Comment


                • #9
                  Oh, right, uhh, yea. Better not use the one in the first post. It's pretty bugged.

                  If someone absolutely needs to use the thing before 1.5 comes out, gimme a PM.

                  As for the zones... well I didn't feel like completely rewriting the SketchMapInfo actor. Players appearing only on one spot on the map was the easiest way to go.
                  Ah, to be a hero. Keeping such company...

                  Comment


                  • #10
                    Do you still believe in 1.5?
                    I don't do

                    Comment


                    • #11
                      Originally posted by Rّé
                      Do you still believe in 1.5?
                      I don't do
                      Mordengaard, DQ and me are on the team. If we don't believe in it ... who will?
                      On demand this signature has been changed. I hope nobody was insulted or got harmed due to my signature. If this is the case, I'm fully responsible for the harm that was done. Do you feel harmed or you simply want a listening ear?

                      Call 0900-PHAE

                      Comment


                      • #12
                        Originally posted by Rّé
                        Do you still believe in 1.5?
                        I don't do
                        That's a bit bizarre, seeing as a couple of servers are already running an updated version of 1.4 written recently by Dalai himself

                        : \
                        Nightmaster,
                        .:Mockers Thievery Guild:.
                        - "until the cat is skinned"

                        Comment


                        • #13
                          Originally posted by PhaeThorn
                          Mordengaard, DQ and me are on the team. If we don't believe in it ... who will?
                          Hey, don't forget me! Mach should be along to help soon too!
                          One of the three LANers of the Apocalypse!
                          -
                          The Unforgiven Casual Gaming Group - New Members Welcome

                          Comment

                          Working...
                          X