Author |
Message |
WarFan Seasoned Helper

Age:53 Gender: Joined: Aug 08 2003 Posts: 141 Location: Clinton, Iowa Offline
|
Posted: 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 |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: 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
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 |
|
Back to top |
|
 |
WarFan Seasoned Helper

Age:53 Gender: Joined: Aug 08 2003 Posts: 141 Location: Clinton, Iowa Offline
|
Posted: 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 |
|
Back to top |
|
 |
SuSE Me measures good

Joined: Dec 02 2002 Posts: 2307 Offline
|
Posted: 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 |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: 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 |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: 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. |
|
Back to top |
|
 |
SuSE Me measures good

Joined: Dec 02 2002 Posts: 2307 Offline
|
Posted: 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
so it'd probably depend on the specific sets to be used what would be required |
|
Back to top |
|
 |
SuSE Me measures good

Joined: Dec 02 2002 Posts: 2307 Offline
|
Posted: 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 get MGB to spell it out for you |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: 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. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
Smong Server Help Squatter

Joined: 1043048991 Posts: 0x91E Offline
|
Posted: 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. |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: 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.
#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 |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Sat Oct 11, 2003 4:15 pm Post subject: |
 |
|
|
|
Edit:nt
Last edited by 50% Packetloss on Sun Oct 12, 2003 8:54 pm, edited 1 time in total |
|
Back to top |
|
 |
Mine GO BOOM Hunch Hunch What What

Age:41 Gender: Joined: Aug 01 2002 Posts: 3615 Location: Las Vegas Offline
|
Posted: 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. |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: 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 |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: 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))
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
}
}
}
} |
Last edited by 50% Packetloss on Sun Oct 12, 2003 8:54 pm, edited 1 time in total |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: 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
Last edited by 50% Packetloss on Mon Oct 13, 2003 9:38 pm, edited 1 time in total |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
|
Back to top |
|
 |
lp Newbie
Joined: Sep 30 2003 Posts: 17 Offline
|
Posted: 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 |
|
Back to top |
|
 |
SuSE Me measures good

Joined: Dec 02 2002 Posts: 2307 Offline
|
Posted: 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) |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
|
Back to top |
|
 |
SuSE Me measures good

Joined: Dec 02 2002 Posts: 2307 Offline
|
Posted: Tue Oct 14, 2003 4:57 pm Post subject: |
 |
|
|
|
cool  |
|
Back to top |
|
 |
|