Server Help

LVZ/LVL Questions - Making lvz images appear

WarFan - Fri Oct 10, 2003 2:49 pm
Post subject: Making lvz images appear
Is it possible to make an lvz image disappear when a ship moves over it and then reappear after it has moved off the image. This would be like for roof tops on building..you would see the roof if you were not in the building, then if you entered it, the roof would disappear. Thanks
50% Packetloss - Fri Oct 10, 2003 3:01 pm
Post subject:
You would need a bot for that, each object can have a number assigned to it
Code: Show/Hide

Example:
W-183,E1,IMAGE59,TopMost,ServerControlled,0,688


So if you do it manually, *objon 688 or *objoff 688 , logged in as a sysop
WarFan - Fri Oct 10, 2003 3:06 pm
Post subject:
Couple questions here.

1) So manually, I would get in a building or watch people get in a building and turn the roof image off?

2) Do you know of a bot that does this or something similar?

Thanks
SuSE - Fri Oct 10, 2003 3:11 pm
Post subject:
you just need a bot to privately send "*objon #" or "*objoff #" when a person flies into a certain area

in fact...I bet if you had the source for the TM Baw plugin for MERVBot, you could get it easily adapted for just this purpose
50% Packetloss - Fri Oct 10, 2003 4:42 pm
Post subject:
No promisses that ill get it done, but Im editing Baw's source for that purpose. Mostly its just cutting pieces out. Trying to think of how im going to detect when everyone is out of the coord's area so that the bot will do a *objon after that(put the roof back on). I need some damn lunch
Smong - Fri Oct 10, 2003 5:08 pm
Post subject:
I was thinking of doing this in an asss module, but never figured out MGB's sparse array thing (what if you are on the border between two regions?). So my current methods of player position detection are not as efficient as they could be.
SuSE - Fri Oct 10, 2003 5:35 pm
Post subject:
50% Packetloss wrote:
No promisses that ill get it done, but Im editing Baw's source for that purpose. Mostly its just cutting pieces out. Trying to think of how im going to detect when everyone is out of the coord's area so that the bot will do a *objon after that(put the roof back on). I need some damn lunch


ya I was wondering about that - it's fine if the person cannot warp out - he just ends up leaving and you have an area which triggers the switch back to the roof on as the person exits...

but...if the person warps out or is killed (etc) then ya...problematic sa_tongue.gif

so it'd probably depend on the specific sets to be used what would be required
SuSE - Fri Oct 10, 2003 5:35 pm
Post subject:
Smong wrote:
I was thinking of doing this in an asss module, but never figured out MGB's sparse array thing (what if you are on the border between two regions?). So my current methods of player position detection are not as efficient as they could be.


cool icon_smile.gif get MGB to spell it out for you
Dr Brain - Fri Oct 10, 2003 7:32 pm
Post subject:
Have a hashmap that contains player names, and thier current 'area'. That way, you only need to change things when their area changes. This is how I handle everything with my warper bots, and It works very well.
Smong - Sat Oct 11, 2003 10:59 am
Post subject:
What if areas overlap? Would you need to create "layers" of areas. So areas cannot overlap unless they are in a seperate layer/hashmap.

I found some doc's on sparse arrays too:
http://www.eecs.harvard.edu/~ellard/Q-97/HTML/root/root.html
Although I probably won't be using one because ops will want to define their own arbitrary areas.

I think I'll go for something like what Dr Brain said.
50% Packetloss - Sat Oct 11, 2003 12:23 pm
Post subject:
Completed it maybe, have to test it and i bet it will crash all over the place. TM Baw keeps track of an ignore list, list ignored a player for a short amount of time, not sure what exactly it was for, maybe if they spawned in a warp area they had time to move. Pretty much i turned that list into one that would hold players that were inside of a object area(InsidePlayers), specified in the .ini file. Once on the list, i can check to see if you left the area, if you did, i check to see if you were the last one out of the area by cycleing through the InsidePlayers list.

Code: Show/Hide

#pragma pack(4)

struct Obj
{
   Sint32 x1, y1, x2, y2; //holds area of the obj
   bool On_Off; //object's state
   Sint32 objNum; //Holds object number
   Sint32 title; //Holds the area number, found in .ini, ex- [obj0]
};

#pragma pack()

struct InsideEntry
{
   char name[20]; //player name thats inside area
   Sint32 title; //the area he is inside, ex- [obj1] found in .ini

   InsideEntry(char *nname,Sint32 ttitle) //constuctor
   {
      memcpy(name, nname, 20);
      title=ttitle;
   }
};


So if im cycling through all the _linkedlist <InsideEntry> InsidePlayer; i can check if any of them are inside a specific area (title). If they arent in that area, then i get to switch the area's state.

In theory, my code in case EVENT_PlayerMove: should regulate it properly, but im sure i fucked up somewhere and with merv, its endless trial and error to fix something. Going to get food before i test it
50% Packetloss - Sat Oct 11, 2003 4:15 pm
Post subject:
Edit:nt
Mine GO BOOM - Sat Oct 11, 2003 11:26 pm
Post subject:
I believe your problem is in your loading of the ObjLocations.head, as the ->next at some point in a linked list should be NULL. Post the code of how you read the values. You probably just forgot to NULL the ->next value when you create the new memory.
50% Packetloss - Sun Oct 12, 2003 2:25 am
Post subject:
ew,thought the class did it for me, ill try it out when im more awake
50% Packetloss - Sun Oct 12, 2003 3:12 am
Post subject:
Code: Show/Hide

TEMPLATE void _linkedlist <AnonymousStruct>::append(AnonymousStruct *item)
{
   _listnode <AnonymousStruct> *new_tail = new _listnode <AnonymousStruct> (item);

   new_tail->last = tail;
   new_tail->next = NULL;

   if (head == NULL)
      head = new_tail;
   else
      tail->next = new_tail;

   tail = new_tail;

   total++;
}


Yep, when i append anything it makes the tail->next=NULL
50% Packetloss - Sun Oct 12, 2003 3:16 am
Post subject:
Edit: NM, i have no idea where it crashes. It crashes before the CheckInside function is called after i move back outside the obj area. So i move into it and it does the correct thing, then i move back out of it and it crashes before it reaches if (!CheckInside(p->name))

Code: Show/Hide
   case EVENT_PlayerMove:
      {
         Player *p = (Player*)event.p[0];

      if(Enabled)
      {
         _listnode <Obj> *parse = ObjLocations.head; // Holds All the obj locations
         String s; // String for turning on and off objects

         if (!CheckInside(p->name)) //if player isnt inside obj area
         {
            while (parse) //Scroll through obj locations
            {
               if (p->tile.x > parse->item->x1 && p->tile.x < parse->item->x2 && p->tile.y > parse->item->y1 && p->tile.y < parse->item->y2)
               { // Check locations

                  if(!CheckTitle(parse->item->title)) //Is anyone already in the obj area??
                  { 
                     if(parse->item->On_Off) //No one in obj area, switch its state for new person
                     {
                        s = "*objoff "; //object off command
                        parse->item->On_Off=false;
                     }
                     else
                     {
                        s="*objon "; //object on command
                        parse->item->On_Off=true;
                     }

                  }
                  AddInside(p->name,parse->item->title); //Add to inside bot list

                  s += parse->item->objNum; //add on object number
                  sendPublic(s.msg); //send command
                  break; //break out of loop
               }

               parse = parse->next; //go to next positions in list
            }
         }
         else //if the player was inside obj area, see if they are still there
         {
            while (parse) //cylce through locations
            {
               if (p->tile.x > parse->item->x1 && p->tile.x < parse->item->x2 && p->tile.y > parse->item->y1 && p->tile.y < parse->item->y2)
               {
                  break; //they have been found inside, exit the loop
               }
               parse = parse->next;//go to next positions in list
            }

            if(!parse) //if no more locations; then they left the obj area
            {
               sendPublic("*arena You have left the area, removing name");
               RemoveInsidePerson(p->name);//remove them from inside of obj area list
               sendPublic("*arena Name Removed");
               if(!CheckTitle(parse->item->title)) // If no one inside obj area
               {
                  if(parse->item->On_Off) //switch its state becuase everyone left
                  {
                     s = "*objoff "; //object off command
                     parse->item->On_Off=false;
                  }
                  else
                  {
                     s="*objon "; //object on command
                     parse->item->On_Off=true;
                  }
                  s += parse->item->objNum; //add on object number
                  sendPublic(s.msg); //send command
               }
            }
         }
      }

50% Packetloss - Sun Oct 12, 2003 1:11 pm
Post subject:
Added my source, Edit: Cleaned up new parse objects being created in every function, just placed ones i commonly used as private vars. Also place the code into the most recent tutorial version
50% Packetloss - Mon Oct 13, 2003 2:38 am
Post subject:
NM found the problem.

Code: Show/Hide
if(!parseObj) //if no more locations; then they left the obj area
            {
               sendPublic("*arena You have left the area, removing name");
               RemoveInsidePerson(p->name);//remove them from inside of obj area list
               sendPublic("*arena Name Removed");
               if(!CheckTitle(parseObj->item->title)) // If no one inside obj area
               {
                  if(parseObj->item->On_Off) //switch its state becuase everyone left
                  {
                     S = "*objoff "; //object off command
                     parseObj->item->On_Off=false;
                  }
                  else
                  {
                     S="*objon "; //object on command
                     parseObj->item->On_Off=true;
                  }
                  S += parseObj->item->objNum; //add on object number
                  sendPublic(S.msg); //send command
               }
            }
         }

doing a parseobj->item, when parse is NULL here. thats game over for any program
lp - Tue Oct 14, 2003 3:08 pm
Post subject:
actually, ive already gotten this working really well(roofbot)... but my problem is ... im trying to bring up the images in diagonal slices in certain parts of the level. as in, you could see only what your ship could see.

Anyway... when i try to line up two diagonal images.. i always get an ugly black line along the diagonal. ive tried to invert the selection in PS, ive overlapped selections and i still get the ugly. using standard 8-bit indexed images and such. any help would be greatly appreciated.

leep
SuSE - Tue Oct 14, 2003 3:49 pm
Post subject:
lp wrote:
im trying to bring up the images in diagonal slices in certain parts of the level. as in, you could see only what your ship could see.


uh...attach the images to your next post, I'm having trouble visualizing what you mean (and of course someone will be able to line them up properly for you)
50% Packetloss - Tue Oct 14, 2003 4:34 pm
Post subject:
Bot Complete, moved it to bot forum for you Akai

http://forums.minegoboom.com/viewtopic.php?p=10891#10891

Go there to download biggrin.gif
SuSE - Tue Oct 14, 2003 4:57 pm
Post subject:
cool icon_smile.gif
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group