It is currently Thu, 09 September 2010 6:01 am




Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next
Entity file entries for off-world transporting 
Author Message
Administrator
User avatar

Joined: Sat, 20 July 2002 4:14 am
Posts: 2695
Location: OR, USA
Post Entity file entries for off-world transporting
Using Deacon's excellent how-to on entity creation http://www.clanwos.org/forums/viewtopic.php?p=31041&highlight=viewpos#31041, you can add your favorite goodies, including support for off-world transport.

I have tweeked the primary map on Phlem's Meet 'n Greet to use entity files now instead of hardcoding, and came up with a mildly useful approach to making this work in a generic manner.

For each of 7 different off-world maps, I add a "key" or "misc" item unique to that server, also in the entity file. This object appears above the teleporter until you go through it.

The reason for doing this is that generating a trigger box around the teleport (as is done in the hacked bitchweiser map that I had running on the Phlem server before) is not possible using entity files, at least not that I have been enable to determine.

The scheme I came up with (subject to evolution based on user feedback) is as follows:

Server 1 - key_blue_key (loxophilia in my example)
Server 2 - key_red_key (Lox Unlimited in e.g.)
Server 3 - key_data_cd (mr bo's in e.g.)
Server 4 - key_data_spinner (deacons primary server in e.g.)
Server 5 - key_pass (wixen's in e.g.)
Server 6 - item_ancient_head (mr cctv's in e.g.)
Server 7 - key_pyramid (deacon's secondary serer in e.g.)

Note that these servers were picked because they seemed to be running when I did this experiment ... :roll: If your server (or your favorite server) is not in this list, there was nothing meant by the disclusion.

The Phlem Server is loaded with these now, applied to the Wos_Temple map. It's a big map, though, so you have to hunt a bit to find where the offworld teleporters are located.

If you want to try this for your server and favorite map / maps, you can create the standard ent file per Deacon's how-to, then simply paste the attached ENT fragment to the bottom of your ent file, and edit the coordinates to match where you want things to be in your map.

Code:
{
"origin" "560 -2200 -474"
"targetname" "ledge"
"target" "q2@207.210.230.240"
"classname" "misc_teleporter"
}
{
"origin" "560 -2200 -443"
"classname" "key_blue_key"
}
{
"origin" "1158 705 -186"
"targetname" "ledge"
"target" "q2@65.99.206.74"
"classname" "misc_teleporter"
}
{
"origin" "1158 705 -155"
"classname" "key_red_key"
}
{
"origin" "-141 1417 -335"
"targetname" "ledge"
"target" "q2@mrbo.dyndns.org"
"classname" "misc_teleporter"
}
{
"origin" "-141 1417 -304"
"classname" "key_data_cd"
}
{
"origin" "-446 -434 -186"
"targetname" "ledge"
"target" "q2@deaconstomb.org"
"classname" "misc_teleporter"
}
{
"origin" "-446 -434 -155"
"classname" "key_data_spinner"
}
{
"origin" "46 2011 -344"
"targetname" "ledge"
"target" "q2@212.242.234.154"
"classname" "misc_teleporter"
}
{
"origin" "46 2011 -313"
"classname" "key_pass"
}
{
"origin" "1714 -1062 -188"
"targetname" "ledge"
"target" "q2@mrcctv.ath.cx"
"classname" "misc_teleporter"
}
{
"origin" "1714 -1062 -157"
"classname" "item_ancient_head"
}
{
"origin" "-9 -984 854"
"targetname" "ledge"
"target" "q2@deaconstomb.org:27911"
"classname" "misc_teleporter"
}
{
"origin" "-9 -984 885"
"classname" "key_pyramid"
}


Here is a hint: when you do the viewpos, subtract 31 from the Z axis coordinate, but only for the TELEPORTER coordinate, not for the item.

Using the LOXophilia entry as an example:

Here is the LOXophilia ENT example singled out:

Quote:
{
"origin" "560 -2200 -474"
"targetname" "ledge"
"target" "q2@207.210.230.240"
"classname" "misc_teleporter"
}
{
"origin" "560 -2200 -443"
"classname" "key_blue_key"
}

The BOLD text is the Z coordinate for the teleporter pad.

Let's assume that you went into your favorate map to scout out some locations for offworld teleporters, found a good spot, ran viewpos, and came up with these numbers:

-224, 1044, -125

(these are X, Y, and Z numbers)

You would substitute in these new coordinates into the above example, subtracting 31 from the Z coordinate for the teleporter only.

Your new ENT file entry would look like this:

Quote:
{
"origin" "-224 1044 -156
"targetname" "ledge"
"target" "q2@207.210.230.240"
"classname" "misc_teleporter"
}
{
"origin" "-224 1044 -125"
"classname" "key_blue_key"
}

Again, note the Z coordinate for the teleporter.

On the Phlem server, I have a special bit of code that plays a unique sound for each of the 7 teleporters (you may notice an items/teleportX.wav file download when you connect). Of course, if you go through the teleporter, you will not hear the sound, as you have just jumped to another server. :wink: After this code is shaken down a bit, I will look at adding it to the core LOX code.

You might have noticed the "targetname" "ledge" entries in the examples. In this case, I picked a real teleporter targetname from the larger entity file. All this really does is cut down on the erroneous error messages that are generated on the server when the map and entity files are loaded. If you have a bogus value in there, it won't really hurt anything.

The only downside I have seen on this so far is that the keys do not seem to come back very fast, sometimes not at all until the map is reloaded. That means if someone has gone through the teleporter, you can no longer see it looking any different than a regular teleporter. I am still working on this ... :lol:

Feel free to play around with this and add it to your server entity files if you want. Of course, you can choose whichever target destination hosts you want, and even replicate them.

- Phlem

PS - I have a Linux build of ENTDUMP available if anybody needs one. I can also send you a copy of the Windows ENTDUMP.EXE if you can't download it for some reason.


Fri, 27 January 2006 4:25 pm
Profile YIM
WOS Member
User avatar

Joined: Sat, 16 August 2003 4:41 pm
Posts: 1436
Location: New Jersey, USA
Post 
hmmm.... i like the idea of having actual text instead of symbols better... but thats jus me :lol: :roll:

_________________
Image
Chris
http://skies.clanwos.org/index.html


Wed, 31 May 2006 6:40 am
Profile ICQ YIM WWW
Administrator
User avatar

Joined: Sat, 20 July 2002 4:14 am
Posts: 2695
Location: OR, USA
Post 
SKIES, what is the pont of your comment? Do you have a way of adding entities that generate text? Without changing the Q2 client code or server code itself? If so, I would love to hear it.


Wed, 31 May 2006 8:39 am
Profile YIM
WOS Member
User avatar

Joined: Sat, 16 August 2003 4:41 pm
Posts: 1436
Location: New Jersey, USA
Post 
ehh... i was kinda suggesting an idea...... BUT.... i will give some ideas.. i really dont know if these will work. I know i "opened a can of worms" so i will try to clarify myself.

hmmm... *thinks*

-what about using an invis proximity device instead of the visable ent, sorta like an ent thats non-solid, but when near it it gives of a messege telling which server it is. maybe use a text file to get the server names & IP so you dont have to recompile it each time? or maybe a batch file to quickly ping the servers too.

this seems like it could work if you did it right.

_________________
Image
Chris
http://skies.clanwos.org/index.html


Wed, 31 May 2006 12:44 pm
Profile ICQ YIM WWW
Administrator
User avatar

Joined: Sat, 20 July 2002 4:14 am
Posts: 2695
Location: OR, USA
Post 
There is no recompiling going on with the given example I provide here. In case you did not real the whole thing (yeah, there is a lot there), the point is that you can construct these entity files for any map and the map will play, no recompiling, no re-downloading.

Your comment was "gee, it would be nice if there was a text message". I agree, it would be nice. My response was "yeah, but I don't know how to make that work with entities, do you?"

So, are you offering a suggestion as to how this idea of yours would work?


Wed, 31 May 2006 2:31 pm
Profile YIM
WDL
User avatar

Joined: Sat, 20 July 2002 5:53 pm
Posts: 1616
Location: Texas
Post 
Recently, there have been a few times while on a map I have seen text messages pop up on my screen. One was where you would shoot a pic on that LAG made map, open area, rail only, has a mound with 4 bisecting 90 degree tunnels on it in the middle, and the map on rotation now that says "Passageway blocked" when you are in an underground tunnel and you run unto the wall. It seems with the everpresent changing ip's that a regular fair amount of work would be needed to maintain connectivity. It's all magic to me.

The well written information above is a testament to your inventiveness Phlem, it's a gas jumping to different server this way. I am a little concerned the Borg will find out about this new technology and assimilate us. You've seen all the Borg among us that have their ears assimilated recently haven't you?
Image

_________________
Image


Wed, 31 May 2006 3:23 pm
Profile
WOS Member
User avatar

Joined: Sat, 16 August 2003 4:41 pm
Posts: 1436
Location: New Jersey, USA
Post 
Grasshopper, that messege you are refereing to, is due to a trigger_multible entity I placed in that map.

phlem wrote:
So, are you offering a suggestion as to how this idea of yours would work?


yes i was offering.... hmmmm... i can prgram in VB so.... lets see....

maybe........ copy the code from any ent, get rid of the model ref code, then insert the prox code from the floating mine nades, add the code that allows the server to print messeges on the screen (cprintf), and tag it all together so that it prints a messege when near the tele? would that work? sry if it is unclear :oops:

adding a trigger_multiple would increase the # of ents... so that would not work; wanna keep those minimal. i would also delay the tele action by 1-2sec too :) too keep accidental tele'ing from happening.

_________________
Image
Chris
http://skies.clanwos.org/index.html


Wed, 31 May 2006 4:39 pm
Profile ICQ YIM WWW
WDL
User avatar

Joined: Tue, 24 September 2002 4:02 pm
Posts: 3420
Location: So. California
Post 
Phlem, I am not sure if I have the hacked bitchwiser map on my laptop but I will look. I would like details of how you implemented those items because the text idea was superb.

What about adding a new spawn function for class off_world_teleport with an areaportal function? We could then put up the ent's custom text up as they do in the game for "This door opens elsewhere" doors. Seems to me that this is a game/server-side kind of thing anyway. I am talking out my back end here since I have not even looked past the special ent loading function since you added it to the code but it seemed to me that all the offworld stuff needed was a special spawn function for that class.

I only skimmed your initial post but I'd like to take some time to work out the details for this and come up with a modular solution for it even if it takes some special code in the game module.

I promise to look at the special map and see if I have a secret decoder ring to figure out how those items were defined.


Wed, 31 May 2006 5:30 pm
Profile YIM WWW
Administrator
User avatar

Joined: Sat, 20 July 2002 4:14 am
Posts: 2695
Location: OR, USA
Post 
The text idea is good. No issue with that point. The solution offered here was a "budget" idea to make use of what I had implemented in the code. I was hoping some of our mapper folks might bite and try it out at least, rather than sit on the sidelines and say "gee, I don't like it this way", so was looking for some more constructive engagement than SOB's post offered. Help me out here, Skies. :lol:

The portal concept can work, Wabby. I agree that a server side solution is probably the easiest thing in general, but I have another server side code idea that I think will be easier to manage and will play with that. I think the entity loading that you already had in there is probably more robust that the code I added. In my last special variation of the code, I actually used your entity loading and it worked fine.

Meanwhile, I came up with another entity-only idea that would actually be very easy to implement. To make it "pretty" I just need a simple custom model or two. I'm banging away on my Milkshape to see if I can make it work. If it works, anyone with PaintShop Pro or any half-decent paint tool could skin the model with what would amount to a target-specific sign-post in about five minutes. I'll play with this some more and get back to you.


Wed, 31 May 2006 8:08 pm
Profile YIM
WOS Member
User avatar

Joined: Sat, 16 August 2003 4:41 pm
Posts: 1436
Location: New Jersey, USA
Post 
ah hem... i am tryin to help.....

dude.. ive also made the map q2_tele... in an effort to fix this when you first made the changes. tho this was only a small effort i guess...

i guess i am not much of help if i dont know C++ much :? :(

either that or i cant explain myself... *tries to think*

_________________
Image
Chris
http://skies.clanwos.org/index.html


Wed, 31 May 2006 8:52 pm
Profile ICQ YIM WWW
WDL
User avatar

Joined: Tue, 24 September 2002 4:02 pm
Posts: 3420
Location: So. California
Post 
Making a superficial tentative suggestion here after looking at the map entities and some of the code.

What do you think of this idea?

New spawn function: SP_misc_offworld_teleport
The usual stuff here, uses a special model of your own design or we can continue to use the standard teleport pad. This would allow the spawn to not need a fake destination pad since it would be a new object.

Inside this spawn funct: trig->touch = offworld_touch

New function offworld_touch performs the offworld transport and the stuff you added to the old teleporter_touch, this would restore the old teleporter_touch function to it's old ways as internal teleporter.

Add elements of SP_trigger_multiple to SP_misc_offworld_teleport accomodate what we need to do to allow proximity of player to the pad to get it to send the message to the client. This gives us the text capability in the same manner as the doors and triggers, etc. I think Carmac called this areaportals. It's what makes the doors squawk when you try to open them or approach a region of sound.

So we end up with a zone around the pad that triggers the text event and the pad contact triggers the teleport event. Elvis leaves the building.

Sketchy, I know, but it keeps the offworld functions separate from the original spawn functs for the old pads and allows a little more freedom and modularity of the design. A few extra members to the ent struct (if any) and we are done.

Sorry if this is over the heads of the general group since you have never seen the code but bear with me a little, we still value the input of the group as to what these features should do. Implementation details are the province of the Phlem-ster since he knows this code in depth and I have only just started to look at it seriously tonight.


Wed, 31 May 2006 10:04 pm
Profile YIM WWW
Administrator
User avatar

Joined: Sat, 20 July 2002 4:14 am
Posts: 2695
Location: OR, USA
Post 
I think your idea has merit, Wabby. It's probably a little more work than my idea, but I think more reasonable in terms of behavior and extensivility.

Are you offering to help code this? Or simply offering up an implementation idea? Either is OK.


Thu, 01 June 2006 9:18 am
Profile YIM
WDL
User avatar

Joined: Tue, 24 September 2002 4:02 pm
Posts: 3420
Location: So. California
Post 
A little of both. You know it better than I right now so you can take point if you have the time. You know where your changes are so if you want to point me at the functions that were touched we can diff them in the VSS history and begin there. I will need to figure out how the zone trigger works and I can take that part of it and lay the basis for the new pad spawn function and we can migrate the functionality out of the modified functions and into the new ones. I will also have to start documenting this in the source because I can't remember what I said in the post last night... I've slept since then. :D


Thu, 01 June 2006 3:36 pm
Profile YIM WWW
WDL
User avatar

Joined: Tue, 24 September 2002 4:02 pm
Posts: 3420
Location: So. California
Post 
Modified:
g_misc.c
added SP_misc_offworld_teleporter()
added offworld_teleporter_touch() and copied your code and comments into it.

g_spawn.c
added classname "misc_offworld_teleporter" and pointer to spawn function.

Doing entdump on bitchweiser_lox2 to see how you did the text messages and triggers for the hacked map.

/* our new entity:
{
"target" "q2@67.15.20.10"
"message" "Offword transport to\nLOXophilia\n(67.15.20.10:27910)"
"wait" "3"
"sounds" "2"
"origin" "576 736 116"
"classname" "misc_offworld_teleporter"
}

Anything else we need to include in it?


Sat, 03 June 2006 6:46 am
Profile YIM WWW
WOS Member
User avatar

Joined: Sat, 16 August 2003 4:41 pm
Posts: 1436
Location: New Jersey, USA
Post 
see now this is why i need to learn C++ (over the summer i will be)

i really want to help with the dev of LOX.... but yet i know next to nothing about C++.............

_________________
Image
Chris
http://skies.clanwos.org/index.html


Sat, 03 June 2006 10:16 am
Profile ICQ YIM WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page 1, 2  Next


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB © phpBB Group.
Style designed by Vjacheslav Trushkin