May 22, 2019, 07:45:10 AM

Author Topic: New Command being added to 0.8.2 wcs.Command().Delayed()  (Read 1500 times)

Offline Jeff

  • Level 7 Expert
  • *****
  • Posts: 459
    • J3ff's Source Scripts
New Command being added to 0.8.2 wcs.Command().Delayed()
« on: March 08, 2008, 03:41:30 AM »
I know alot of races have been using their own delay tracking to stop delays either once a person dies or when the round ends... I have also seen this being used wrong... to make it easier to use I have added the wcs.Command().Delayed() command.

The syntax and how it works:

Code: (python) [Select]
wcs.Command(<userid>).Delayed(<duration>,<function to call>,[parameters],[kill on endround instead of user death])
The difference between using this command to call your delays instead of gamethread is that this delay will be ended if the player matching userid dies. Or if you have the 4 optional argument for the command it will stop the command on round end instead.

This makes it so the wcs.py handles all these messy cancels internally instead of the coders having to do it themselves! As always if you really want to go through the hassle you can still use gamethread but this is just one other option for you.

~J3ff

Offline Zero Skillz

  • Level 7 Expert
  • *****
  • Posts: 525
Re: New Command being added to 0.8.2 wcs.Command().Delayed()
« Reply #1 on: March 08, 2008, 01:03:49 PM »
Nice!! lol this will make life much easier... also if you code something in Ess clasic, can you still put python commands in it??? and if you put a est command in it, is the es est_speed or waht ever is the es still needed??like would this work?

es est_speed event_var(userid) 1.5

ok thanks

Offline Kevin002

  • Level 3 Trained Apprentice
  • ***
  • Posts: 61
Re: New Command being added to 0.8.2 wcs.Command().Delayed()
« Reply #2 on: March 08, 2008, 01:13:31 PM »
youd have to do es.server.queuecmd("es est_speed %s 1.5", event_var['userid'])

Offline freddukes

  • Level 7 Expert
  • *****
  • Posts: 359
  • Country: 00
Re: New Command being added to 0.8.2 wcs.Command().Delayed()
« Reply #3 on: March 08, 2008, 02:05:59 PM »
You cannot mix ESS and ESP commands with each other... If you code a race in ESS, it must be 100% in ESS or 100% ESP...

So you can either code in ESS and put es est_speed event_var(userid) 1.0 or you can do wcs.Command(userid).Speed(1.0)

-freddukes

Offline Zero Skillz

  • Level 7 Expert
  • *****
  • Posts: 525
Re: New Command being added to 0.8.2 wcs.Command().Delayed()
« Reply #4 on: March 08, 2008, 02:28:12 PM »
sweet thanks :D