Author
Topic: Teleport (Read 557 times)
Let me make it simple for you. You and people like you are the very reason we don't post anything. Here's a clue: try the damn file and than ask questions because it does work well. It's geared to accept and react as close to the coding that est did. You won't get another response as you have done nothing but make necavi's point stated earlier in this thread.
Tl:dr try it and than comment so you don't look like a moron
well post some stuff here, ignore those guys, if someone can work with that great if not then never mind just ignore know what i mean?
I would rather do it myself than be handfed, then again, I consider getting the code at all being handfed, if you are unable to implement it, or read and reverse engineer it, then there is no hope for you.
Oh, Does I said that this doesn't work bad?
Oh if I said forgive me all I doesn't wanted that.
Well I appreciate you sharing Joshtrav and most of the community will, and if I use your code in next release I am sure many will be happy you shared.
You can not please everyone - just the way it is , but thanks again!
Just something for you guys to look at; this is how I would have done it with vecmath. It cuts the calls down no end. Also, there is very little "hacky" code in here.
import es import vecmath import cmdlib
# -------------------- # Teleport courtesy of: # # www.joinWCS.com # 72.5.102.36:27015 # # Credits: # MaxLap # joshtrav # # --------------------
def load(): cmdlib.registerServerCommand("wcs_teleport", teleport_ultimate, "wcs_teleport <userid> <distance>") def unload(): cmdlib.unregisterServerCommand("wcs_teleport")
def teleport_ultimate(args, distance=None): if distance is None: userid, distance = map(int, args) else: userid, distance = args, distance if not es.exists("userid", userid): return es.prop_dynamic_create(userid, 'props_c17/tv_monitor01_screen.mdl') index = int(es.ServerVar("eventscripts_lastgive")) if index < 1: return view = vecmath.Vector(es.getindexprop(index, "CBaseEntity.m_vecOrigin")) es.remove(index) distance *= 3 loc = vecmath.Vector(es.getplayerlocation(userid)) vect = (view - loc) * 2 cur_distance = vect.length() vect = vect.setlength(min(cur_distance, distance)) if vect[2] > distance: vect[2] = distance maxhoriz = max((abs(vect[0]), abs(vect[1]))) if maxhoriz > 2000: rat = 2000. / maxhoriz vect[0] *= rat vect[1] *= rat if vect[2] > 2000: vect[2] = 2000.0 elif vect[2] < -2000: vect[2] = -2000.0
cvel = [es.getplayerprop(userid, 'CCSPlayer.baseclass.localdata.m_vecVelocity[%s]' % x) for x in xrange(3)] nvect = [str((-cv + v) * .9852) for v, cv in zip(vect, cvel)] es.setplayerprop(userid,'CBasePlayer.localdata.m_vecBaseVelocity', ",".join(nvect)) This seemed to work on my box when I tested it.
Vecmath is awesome If you're ever dealing with vectors, I highly advise that you use it. Vecmath cut the lines from 104 -> 58 (well amongst other things too). This also uses cmdlib instead of es.regcmd(); but I suspect on your server you don't even register that command.
-freddukes
Just looked at the code, I could not from the iPhone. However I did discuss this on the ES boards and the fact that lastgive is not reliable. This could be wrong with the most current update but I doubt it considering the implementation of the wait command. My way is strongly to due with the fact that lastgive is far from reliable and often returns the wrong value. That will work great with "you", i.e., 1 player. Try it in a full 40 man server, and watch it crash or individuals get teleported backwards, etc (places other peoples prop is created.) I get that you want it simple, but its not going to be under the current engine. I also tried forcing the cheat command via sourcemod and hooking the entity with SDKhook, and it still fails. It requires at least a gameframe under optimum conditions to render that cheat command, the creation of the entity, and the teleport itself. I highly suggest you test your method with more than just yourself in a test server as I have, and promise you it fails under the previous ES release, which according to a simple python check takes roughly the same amount of time to render and create that addon using a tick listener to check all props for the dynamic on a map like ace_comabatant in the current release. (Note, this is only tested by forcing a script that runs this for all userids on a test currently with a few dozen bots but still should be relatively equal.) Good luck to you, but I will stick with a way that works for more than a single player on a large load. If you want you can refer back to the thread that I already discussed this on the ES boards. Edit- Also to point out for anyone concerned, one of the reasons our server is so well off is because we avoid commands such as: es.remove()
-Edit I will try to run a script on the main tomorrow creating props only and recording returns to see what happens, and compare to the SM log of OnEntityCreated and see how the logs differ or if they are equal with the timestamps and let you know. But again, it doesn't seem to be solved on the test server.
« Last Edit: July 18, 2010, 01:10:06 PM by joshtrav »
Logged
I use sourcemod wcs and sdkhooks well I have it working on my server
I use sourcemod wcs and sdkhooks well I have it working on my server 
you have what working oddity? As fat as tele when I was in your server you were using the sm version whch from the code is viewangle plusba tracer to check for objects which is not similar or are you talking about onentitycreated?
« Last Edit: July 18, 2010, 07:34:24 PM by joshtrav »
Logged
NO I meant the tele with tracer for objects you had it right wasnt sure if u knew
I think that method is preferrable to the old teleport although I havent tried yours yet on, I was only on ur server once a while ago and tele wasnt working yet
NO I meant the tele with tracer for objects you had it right wasnt sure if u knew
I think that method is preferrable to the old teleport although I havent tried yours yet on, I was only on ur server once a while ago and tele wasnt working yet
It is really a toss up I think. I like the old only because you can really aim your teleport so to speak. Like you can angle it like the old days to get to a specific overhang or whatever. I like yours as well because I think the actual teleport is pretty cool. You could merge the too and grab the viewcoord from mine, run a tracer in SM to make sure you are in a wall and use a true teleport like yours. That could be pretty cool.
i always hated the arcing push teleport of wcs so i am leaving mine. it seemed to me like the original creator could do it right and it is a hacky version which bugged me. Anyway thanks for sharing you should consider hte SM version if u are good at it I have gotten a good taste of it and made 3 races in the last two days and soon will have full function server and I have yet to experience lag or crash, i think other than my own hard restarts the server hasnt crashed in a month someitmes between my starts is as long as like 4 or 5000 minutes 
Just started to create my own server, yes I'm a noob, I'm just asking how would you actually put this into your race database for human? I'm inexperienced with coding in this. Thanks  . EDIT: nvm, found solution @ http://warcraft-source.com/board/index.php/topic,10343.0.htmlThanks JT.
« Last Edit: July 23, 2010, 04:59:13 PM by Strickened »
Logged
Still can't get this teleport to work, I have done all as said:
Autoexec.cfg includes es_load joinwcs, uploaded the joinwcs folder to eventscripts/, changed the human skill4 to:
"skill4_setting" "es_xset wcs_range 650;es_xset wcs_fadetimer 1|es_xset wcs_range 700;es_xset wcs_fadetimer 0.9|es_xset wcs_range 750;es_xset wcs_fadetimer 0.8|es_xset wcs_range 800;es_xset wcs_fadetimer 0.7|es_xset wcs_range 900;es_xset wcs_fadetimer 0.6|es_xset wcs_range 1000;es_xset wcs_fadetimer 0.5|es_xset wcs_range 1100;es_xset wcs_fadetimer 0.5|es_xset wcs_range 1200;es_xset wcs_fadetimer 0.5" "skill4_cmd" "es wcs_teleport server_var(wcs_userid) server_var(wcs_range)" "skill4_sfx" "0" "ultimate_cooldown" "10" It is still not working, any Ideas?
Thanks
Changed it from server_var(wcs_userid) to server_var(userid).
This stopped the crashing, but teleport is still not working.
changeing it isnt a fix u basically diabled it mgith as well left it like me with error message 
|