November 18, 2018, 05:44:16 AM

Author Topic: Knife ward tele.  (Read 1095 times)

Offline WCS - Wookie

  • Level 6 Experienced
  • *****
  • Posts: 123
  • Country: nz
  • Qualified Teacher, working in IT and loving WCS.
Knife ward tele.
« on: January 30, 2018, 06:29:06 AM »
Hi guys,

This is something one of my community members requested and in theory I believe it is very doable, in practice I'm not quite sure where to start.

Basically what I am looking to try and do is:
- Place a ward down with the race.
- Make it a chance that when I deal damage to an enemy with a knife/melee attack they get teleported to that ward.

So far I am looking at trying to combine a player_attacker command to get the victims userid and then use something like laser light show's teleport to send them to the coordinates that would have been got for the ward to be placed down.

Now I have absolutely no idea if that is even possible but I am willing to give it a go.

Also any and all idea's around this are helpful as I am kind of clutching at straws.

Update:
This is what I have so far. Still not sure how to grab the coordinates of the existing ward though  :o
Code: [Select]
block paradox
{
if (server_var(wcs_dice) <= server_var(wcs_chance)) do
{
es_xsetinfo wcs_wall "1"
                es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 server_var(wcs_userid)
                es_getplayerlocation wcs_x2 wcs_y2 wcs_z2 server_var(wcs_targetid)
wcs_xalias spec_checkwall
if (server_var(wcs_wall) = 0) do
{
es_set wcs_target server_var(wcs_targetid)
if (server_var(wcs_ok) == 1) do
{
es_playsound server_var(wcs_userid) ambient/atmosphere/cave_hit5.wav 0.9
es_xsetpos server_var(wcs_targetid) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)
wcs_setfx freeze server_var(wcs_targetid) = 1
es_delayed 1 wcs_setfx freeze server_var(wcs_targetid) = 0
es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 server_var(wcs_userid)
}
}
}
}
« Last Edit: January 30, 2018, 06:55:30 AM by WCS - Wookie »
If you like WCS and are from AUS/NZ drop by our server to take a look.


Offline BRAVORA

  • Level 0 Beginner
  • Posts: 17
  • Country: fi
  • Proffesional community server "stress" tester
Re: Knife ward tele.
« Reply #1 on: January 30, 2018, 08:41:34 AM »
So you're telling me that people in the Australian community are wondering if it's possible to teleport people at ward locations, while here in Nordic countries players are wondering "why doesn't this race do 1000 bonus dmg? so bad lul fix race"???

Quote Collection

Quote
Manifest : I love Swedish Women.
Manifest: "I think CSGO will also be a more mature audience when we announce CSGO"
Manifest: "10 inches restraining order from my penis"
Helve: heh if it is really too much i'll just fuck the sandwich

Offline WCS - Wookie

  • Level 6 Experienced
  • *****
  • Posts: 123
  • Country: nz
  • Qualified Teacher, working in IT and loving WCS.
Re: Knife ward tele.
« Reply #2 on: January 30, 2018, 12:12:37 PM »
Don't get me wrong Bravorah, we have those people too. I am however intent on keeping the racelist balanced. In my opinion it shouldn't matter what race you are or what level you are, from the beginning you should be able to access races that can at least compete with the end tier races. Hence the input of more fun based skills for higher tiers like attacks that teleport you into wards.
If you like WCS and are from AUS/NZ drop by our server to take a look.


Offline Manifest

  • Race & effect creator
  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 1047
  • Country: dk
  • Content creator for the new WCS version by Kami.
Re: Knife ward tele.
« Reply #3 on: January 30, 2018, 12:33:12 PM »
Hi Wookie! :-)

This seems rather interesting and I must say it would be very challenging to almost impossible creating this using a push based teleportation because if the target is behind a wall, or there's something blocking him from being pulled towards the ward this will not work correctly. If the ward is mid-air it will not work correctly either, and a lot of other factors. It should be doable to create with an instant teleportation like the one you've been experimenting with in your skill already (setpos).

I did try and do a take on the race, but after finishing it I came to realize it was not even close to what you originally requested so I've removed it again, I hope someone else will help you out with this skill.
« Last Edit: January 30, 2018, 07:28:21 PM by Manifest »
"BRAVORA: Bruh it is fucking operation crystal night when you are approving races."


Offline WCS - Wookie

  • Level 6 Experienced
  • *****
  • Posts: 123
  • Country: nz
  • Qualified Teacher, working in IT and loving WCS.
Re: Knife ward tele.
« Reply #4 on: January 30, 2018, 12:41:15 PM »
As many times as your lucky allows it to. But there is only one ward allowed on the class. So it's not as if they can constantly spam wards and tele people into them.
If you like WCS and are from AUS/NZ drop by our server to take a look.


Offline Ayuto

  • Level 1 Trained Beginner
  • *
  • Posts: 39
  • Country: de
    • Source.Python
Re: Knife ward tele.
« Reply #5 on: January 30, 2018, 06:06:05 PM »
On the note of instant teleportation, when using this NEVER use es_setpos and es_xsetpos as this command is known to create server crashes. Instead I recommend using playerset location for all skills that use setpos, they basically do the same, but the playerset location does not give your server crashes. :-)
Actually, that's not true. In the original ES only the Python variant was known to crash Linux servers if the psyco module was installed (it was installed by default). es_setpos and es_xsetpos always worked on all systems.

However, if it really crashes with the ES emulator, you should create a bug report instead of avoiding it.

Btw. this is how "playerset location" works internally:
Code: [Select]
block setlocation
{
  es_xgetargc _playergetset_temparg1
  if (server_var(_playergetset_temparg1) > 5) do
  {
    es_xgetargv _playergetset_p1x 3
    es_xgetargv _playergetset_p1y 4
    es_xgetargv _playergetset_p1z 5
    es_setpos server_var(_playergetset_userid) server_var(_playergetset_p1x) server_var(_playergetset_p1y) server_var(_playergetset_p1z)
  }
  else do
  {
    es_xdbgmsg 0 Syntax : playerset location <userid> <x> <y> <z>
  }
}
As you can see, it simply forwards the arguments to es_setpos.

Offline Manifest

  • Race & effect creator
  • Moderator
  • Level 7 Expert
  • *****
  • Posts: 1047
  • Country: dk
  • Content creator for the new WCS version by Kami.
Re: Knife ward tele.
« Reply #6 on: January 30, 2018, 06:34:28 PM »
Ayuto that's the thing. This server is in fact using the older version of WCS (ES:P) version as the server has not yet been updated to the new version by Kami since they are awaiting their hosts to adapt something so they can finally upload and start using the newer version. :-)

So they are still using the old WCS version by Tha Pwned with my edits in, so it is not related to the current version using the emulator.

If there had been an issue, I would have reported it in by now. :p
« Last Edit: January 30, 2018, 06:46:04 PM by Manifest »
"BRAVORA: Bruh it is fucking operation crystal night when you are approving races."


Offline Ayuto

  • Level 1 Trained Beginner
  • *
  • Posts: 39
  • Country: de
    • Source.Python
Re: Knife ward tele.
« Reply #7 on: January 30, 2018, 07:27:29 PM »
Nevertheless, es_setpos and es_xsetpos were not crashing and "playerset location" was also using es_setpos internally.

Edit:
Okay, I just had a further look into "playerset location" and saw that a userid validation is done prior to calling es_setpos. So, if es_setpos crashes with a userid greater than 0 that doesn't exist, it would explain why "playerset location" is more stable.
Code: [Select]
block _playerset
{
  es_xgetargc _playergetset_arg1
  if (server_var(_playergetset_arg1) > 1) do
  {
    es_xgetargv _playergetset_cmd 1
    es_format _playergetset_block "corelib/playergetset/set%1" server_var(_playergetset_cmd)
    if (server_var(_playergetset_arg1) > 2) do
    {
      es_xgetargv _playergetset_userid 2
      es_getuserid _playergetset_userid server_var(_playergetset_userid)
      if (server_var(_playergetset_userid) = 0) do
      {
        es_xdbgmsg 0 Player not found!
      }
      else do
      {
        es_doblock server_var(_playergetset_block)
      }
    }
    else do
    {
      es_doblock server_var(_playergetset_block)
    }
  }
  else do
  {
    es_dbgmsg 0 Type playerset server_var(_playerset_commands)
  }
}
« Last Edit: January 30, 2018, 08:02:26 PM by Ayuto »

Offline WCS - Wookie

  • Level 6 Experienced
  • *****
  • Posts: 123
  • Country: nz
  • Qualified Teacher, working in IT and loving WCS.
Re: Knife ward tele.
« Reply #8 on: January 30, 2018, 10:10:24 PM »
Thank you very much for your responses guys!

Just a quick question, how do I get the coordinates from where the player used their ward to be the position that the player is set to?

Like how do I use the wards coordinates in the setpos code?
If you like WCS and are from AUS/NZ drop by our server to take a look.


Offline Eareland

  • Retarded retired
  • Level 7 Expert
  • *****
  • Posts: 712
  • Country: fi
  • Most honest is to be without a word of a lie
    • FSSM
Re: Knife ward tele.
« Reply #9 on: January 31, 2018, 11:19:00 AM »
Thank you very much for your responses guys!

Just a quick question, how do I get the coordinates from where the player used their ward to be the position that the player is set to?

Like how do I use the wards coordinates in the setpos code?

I dont know  whats really going on but maybe i can do something tho im retarded dont mind it.

You need to get location of your player (i'd guess) when you are placing your ward.
i think the command could be something like
Code: [Select]
es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(PLAYERID)
later you can teleport player to set location using this command
Code: [Select]
es_setpos event_var(PLAYERID) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)
But I think wcs group set could be better option if its possible to use it...
here is example from the race:
Code: [Select]
es wcsgroup get absdmg wcs_tmp4 event_var(userid);es_math wcs_tmp4 + event_var(dmg_health);es wcsgroup set absdmg event_var(userid) server_var(wcs_tmp4)


Offline WCS - Wookie

  • Level 6 Experienced
  • *****
  • Posts: 123
  • Country: nz
  • Qualified Teacher, working in IT and loving WCS.
Re: Knife ward tele.
« Reply #10 on: January 31, 2018, 11:42:59 AM »
Thanks Eareland, that makes a lot more sense now I see it.

I haven't done a lot of work with wcs group sets. Is there an explanation as to how they work/ how to use them?
If you like WCS and are from AUS/NZ drop by our server to take a look.


Offline Eareland

  • Retarded retired
  • Level 7 Expert
  • *****
  • Posts: 712
  • Country: fi
  • Most honest is to be without a word of a lie
    • FSSM
Re: Knife ward tele.
« Reply #11 on: February 01, 2018, 10:26:58 AM »
Thanks Eareland, that makes a lot more sense now I see it.

I haven't done a lot of work with wcs group sets. Is there an explanation as to how they work/ how to use them?

I use wcsgroup to store value. Why we do this is because if you use (example) es_xset command to set value, the value can and most likely will change during the match. Example:
Code: [Select]
es_xset wcs_tmp 1337
So we use wcsgroup (set) to store value.

This code here:
Code: [Select]
es wcsgroup get absdmg wcs_tmp4 event_var(userid);es_math wcs_tmp4 + event_var(dmg_health);es wcsgroup set absdmg event_var(userid) server_var(wcs_tmp4)
What really happens up there^ is that 1st we store absdmg's value to wcs_tmp4 (we use then "wcsgroup get"), 2nd we add dmg_health (is the damage you have recently taken when you were shot) value to wcs_tmp4 and 3rd you store wcs_tmp4 to absdmg.

The 1st thing we should do before running command line up there is to create absdmg (I don't really know do we have to create it or does it create itself when we use "wcsgroup get":

Code: [Select]
es wcsgroup set absdmg event_var(userid) 0Setting var to 0 is what we usually do, depends on situation.

WCS has changed so I don't know does this work like this. This is just a quick example how this could work. I use PLAYERID in this example.:

Code: [Select]
es wcsgroup set x1x event_var(PLAYERID) 0;
es wcsgroup set y1y event_var(PLAYERID) 0;
es wcsgroup set z1z event_var(PLAYERID) 0;
es_getplayerlocation wcs_x1 wcs_y1 wcs_z1 event_var(PLAYERID);
es wcsgroup set x1x event_var(PLAYERID) server_var(wcs_x1);
es wcsgroup set y1y event_var(PLAYERID) server_var(wcs_y1);
es wcsgroup set z1z event_var(PLAYERID) server_var(wcs_z1);

and then to teleport user

Code: [Select]
es wcsgroup get x1x wcs_x1 event_var(PLAYERID);
es wcsgroup get y1y wcs_y1 event_var(PLAYERID);
es wcsgroup get z1z wcs_z1 event_var(PLAYERID);
es_setpos event_var(PLAYERID) server_var(wcs_x1) server_var(wcs_y1) server_var(wcs_z1)



wcsgroup is way to store personal value, I'd say. That's why you have to define userid.

someone maybe knows another way to do this and I dont know if my example would even work, but if I remember anything about WCS at all, then I think it should work. But let's say this, I made working races only when I had a chance to test every command line and race skill.

Maybe you got the idea.
« Last Edit: February 01, 2018, 10:30:11 AM by Eareland »


Offline WCS - Wookie

  • Level 6 Experienced
  • *****
  • Posts: 123
  • Country: nz
  • Qualified Teacher, working in IT and loving WCS.
Re: Knife ward tele.
« Reply #12 on: February 01, 2018, 11:24:21 AM »
Thank you very much for the explanation Eareland!

I think I got most of that and I am sure after much testing I should be able to get a better grasp on it.

The wcsgroup get absdmg part. absdmg is just the name of the group right? and this can be changed to whatever I want to call it, so long as I reference the same name later on when doing the wcsgroup set command right?
If you like WCS and are from AUS/NZ drop by our server to take a look.


Offline Eareland

  • Retarded retired
  • Level 7 Expert
  • *****
  • Posts: 712
  • Country: fi
  • Most honest is to be without a word of a lie
    • FSSM
Re: Knife ward tele.
« Reply #13 on: February 01, 2018, 12:10:32 PM »
Thank you very much for the explanation Eareland!

I think I got most of that and I am sure after much testing I should be able to get a better grasp on it.

The wcsgroup get absdmg part. absdmg is just the name of the group right? and this can be changed to whatever I want to call it, so long as I reference the same name later on when doing the wcsgroup set command right?

Yes, it's just the group name, and you can name it whatever you want. You got the idea.  ::)
And yes, group name should remain the same.

Also, here is example of the "teleport to saved location" ultimate skill.
Code: [Select]
block reminiscx1
{
es wcsgroup get resavedloc wcs_tmp server_var(wcs_userid)
if (server_var(wcs_tmp) = 1) do
{

es_getplayerlocation wcs_x3 wcs_y3 wcs_z3 server_var(wcs_userid)
es wcsgroup set resavex1 server_var(wcs_userid) server_var(wcs_x3)
es wcsgroup set resavey1 server_var(wcs_userid) server_var(wcs_y3)
es wcsgroup set resavez1 server_var(wcs_userid) server_var(wcs_z3)
es wcsgroup set resavedloc server_var(wcs_userid) 2
es wcs_cancelulti server_var(wcs_userid)
es_tell server_var(wcs_userid) #multi #greenReminiscence : #lightgreenYou memorized your location
}

if (server_var(wcs_tmp) = 2) do
{


es wcsgroup get resavex1 wcs_tmp wcs_x3 server_var(wcs_userid)
es wcsgroup get resavey1 wcs_tmp wcs_y3 server_var(wcs_userid)
es wcsgroup get resavez1 wcs_tmp wcs_z3 server_var(wcs_userid)
es playerset location server_var(wcs_userid) server_var(wcs_x3) server_var(wcs_y3) server_var(wcs_z3)
es wcsgroup set resavedloc server_var(wcs_userid) 1
es_tell server_var(wcs_userid) #multi #greenReminiscence : #lightgreenYour memory came true
}

}
« Last Edit: February 01, 2018, 12:22:04 PM by Eareland »


Offline BRAVORA

  • Level 0 Beginner
  • Posts: 17
  • Country: fi
  • Proffesional community server "stress" tester
Re: Knife ward tele.
« Reply #14 on: February 01, 2018, 12:31:51 PM »
Eareland is coming back in fashion (not really but let a man pray for something)

Quote Collection

Quote
Manifest : I love Swedish Women.
Manifest: "I think CSGO will also be a more mature audience when we announce CSGO"
Manifest: "10 inches restraining order from my penis"
Helve: heh if it is really too much i'll just fuck the sandwich