Archived copy of warcraft-source.com, the Warcraft: Source (WCS) forum (2007–2011), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2008-04-12 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
April 12, 2008, 08:59:51 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Remember to check on the FAQ before start posting.
It may save you time and effort.
Also here is the WCS Wiki!
Google  
  Home   Forum   Help Search Login Register   *
Pages: [1]   Go Down
  Print  
This topic has not yet been rated! You have not rated this topic. Select a rating:
Author Topic: [Preview] wcs_setfx function in v0.76  (Read 379 times)
kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1096



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« on: September 27, 2007, 09:43:30 PM »

This shows you the upcoming nice function called "wcs_setfx". (300 lines of code!!)
Basically it gives game effects to a player (not graphical!), enables a large number of skills/ideas and is error-proof.
Here is the syntax:

Quote
wcs_setfx <TYPE> <USERID> <OPERATOR> <PARAMETER> <TIME>

supported types are: freeze speed god invis(0-255) invisp(in %) health armor gravity disguiser 1stclip 2ndclip longjump

in future, this will replace the "wcs_removefx", because you can do very more with this and it also checks for dead players on delayed effects

looks complicated, but this enables you to do non-trivial skills within one command!
eg.

giving a player 20% more speed, for 10 seconds (STACKABLE and return to previous value after the time)
Quote
es wcs_setfx speed event_var(userid) + 0.2 10

take from an enemy 100 armor for 15 seconds (back to previous armor after this)
Quote
es wcs_setfx armor event_var(userid) - 100 15

set a player to 20% longjump action, for 5 seconds
Quote
es wcs_setfx longjump event_var(userid) = 1.2 5

give a player permanent +30 bullets for his primary weapon (works after reload, if eventscripts_noisy=1)
Quote
es wcs_setfx 1stclip event_var(userid) + 30 0

disguise for 30 seconds (after, switch back)
Quote
es wcs_setfx disguise event_var(userid) = 1 30

the special about this is, it doesn't raise ERRORS in console log, it checks all values for correctness (eg. invisibility percent between 0-100), enables giving and taking, is stackable and supports timed effects.
So you can have a race with 70% invis, and if you buy a shopitem that gives you +50% invis for 30 seconds, you are complete invis for this time and AFTER you switch back to 70%

be prepared to code some nice skills 

[note for the pro's: this enables safe skill coding with different aspects and is very good for fast balancing races. Also, beginners are now able to create not so easy skills, like timed effects or enable stacking of skills]
Logged

(click to show/hide)
BrettLefty
WCS ESP Dev Team
Level 6 Experienced

Offline Offline

United Kingdom

Posts: 142



WWW
slasher123
« Reply #1 on: September 27, 2007, 09:46:37 PM »

Thats gonna be beautiful, considering the xkeygetvalue command doesn't work at all right now.
Logged

/////d00dz Clan Warcraft Mod Server\\\\\  |   216.69.179.161:27035
kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1096



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« Reply #2 on: September 27, 2007, 09:55:32 PM »

hehe yes, you made a small mistake. With that one command, you would reduce your error sources

your skill in the support forum would be like this:
Quote
"skill4_cmd"   "
es es_xkeygetvalue wcs_tmp WCSuserdata server_var(wcs_userid) speed;
es es_xtell server_var(wcs_userid) : You begin to charge!;
es es_xdelayed server_var(wcs_duration) es_xtell server_var(wcs_userid) : You slow down.;
es es_xdelayed 0.2 est_Speed server_var(wcs_userid) server_var(wcs_speed);
es es_xdelayed server_var(wcs_duration) est_Speed server_var(wcs_userid) server_var(wcs_tmp);
es est_gethealth wcs_health server_var(wcs_userid);
es es_xsetinfo wcs_health_tmp server_var(wcs_health);
es es_xmath wcs_health + server_var(wcs_hp);
es est_sethealth server_var(wcs_userid) server_var(wcs_health);
es es_xdelayed server_var(wcs_duration) est_sethealth server_var(wcs_userid) server_var(wcs_health_tmp)"

Quote
"skill4_cmd" "es wcs_setfx speed server_var(wcs_userid) = server_var(wcs_speed) server_var(wcs_duration);es_xtell bla...;es wcs_setfx health server_var(wcs_userid) + server_var(wcs_hp) server_var(wcs_duration);es_xtell bla..."

just two lines of code. if you compare with your code, the new commands saves some work and is less error sensitive 
Logged

(click to show/hide)
BrettLefty
WCS ESP Dev Team
Level 6 Experienced

Offline Offline

United Kingdom

Posts: 142



WWW
slasher123
« Reply #3 on: September 27, 2007, 11:55:33 PM »

actually, the problem was that i never set the value to 0.5 upon spawn 
Logged

/////d00dz Clan Warcraft Mod Server\\\\\  |   216.69.179.161:27035
HOLLIDAY
<Race Maker>
Watchdogs
Level 7 Expert
*****
Offline Offline

Posts: 1521



WWW
Wc3_HOLLIDAY_Wc3
wc3hollidaywc3

myServer 72.249.51.26:27015 72.21.36.203:27015
(Warning: click connects through Steam)
« Reply #4 on: September 28, 2007, 05:19:46 AM »

Wow...this is going to create thousands of races....maybe non copy + paste with this  function
Logged



c6464
Guest
« Reply #5 on: September 28, 2007, 06:30:46 AM »

cooooool
Logged
Stinkyfax
Watchdogs
Level 7 Expert
*****
Offline Offline

Lithuania Lithuania

Posts: 1054



WWW
Xrushiov
« Reply #6 on: September 28, 2007, 08:38:59 AM »

please do not remove wcs_removefx since it's smaller and runs faster.
Logged

NovaKiller
<WCS coder>
Level 7 Expert
*****
Offline Offline

Denmark Denmark

Posts: 772


Loves WCS. Loves to make races. Loves to play WCS


WWW
PlaxGunner
« Reply #7 on: September 28, 2007, 01:34:07 PM »

Hey nice. That sounds all good, and yeah wcs_removefx is a good command too i also dont like removing it. 2 points to that. 1) its a small and good command, 2) i dont want to redo all the skills that got wcs_removefx in
Logged

kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1096



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« Reply #8 on: September 28, 2007, 02:12:02 PM »

hmm right...if you have complex commands and still need removefx, this command is better (because of performance!)
here a benchmark
Quote
es_xset a 0
es_xset b 0.0
while "server_var(a) < 1000" "wcs_removefx freeze 2;es_math b + server_var(removefx);es_xmath a + 1"
"b" = "0.759966" ( def. "" )
while "server_var(a) < 1000" "wcs_setfx freeze 2 = 0;es_math b + server_var(setfx);es_xmath a + 1"
"b" = "1.354198" ( def. "" )

removefx: 28 lines code, 3 choices
setfx: 303 lines code, 12 choices

so, especially because less if(...) checks, removefx is almost 2x faster. The difference for a single call is 0.006 seconds.

wcs_removefx will still stay in the mod, but its not extended in future (so it keeps fast )
Logged

(click to show/hide)
Frodo
WCS ESP Dev Team
Level 7 Expert

Offline Offline

Posts: 766


Actinosphaerium eichhorni


WWW
ckenduro
aulix
« Reply #9 on: September 28, 2007, 05:13:12 PM »

Better not remove it but just keep it. Coders will use wcs_setfx (including me )
Logged

Goodbye. If you still want to contact me, write on [email protected].
=[LSS]= Soldier
Level 7 Expert
*****
Offline Offline

United States United States

Posts: 539


Hi


WWW
Soldier62994
« Reply #10 on: September 29, 2007, 02:37:47 AM »

Thats a lot easier 
Logged


=[LSS]= NEW Wc3 Server
Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
April 11, 2008, 11:39:01 PM
yea correct, i love it ^^
April 11, 2008, 04:39:20 PM
lol that cam out Yesterday right? for pc
April 11, 2008, 03:46:38 PM
Assassin's Creed!
April 11, 2008, 01:54:51 PM
i hope thats true
April 11, 2008, 11:30:03 AM
was geht ab jungs!!!! xD
April 11, 2008, 11:18:11 AM
hallo ihr lieben gamer
April 11, 2008, 10:40:19 AM
im teh kind of person that kills... in CSS!
also you have people plotting about other people and some nice people... (you dont see those alot though...)
Recent
[Today at 05:03:20 AM]

[Today at 04:24:40 AM]

[Today at 03:50:26 AM]

[Today at 03:04:38 AM]

[Today at 12:11:37 AM]

[April 11, 2008, 11:34:15 PM]

by Jeff
[April 11, 2008, 08:30:58 PM]

[April 11, 2008, 08:09:05 PM]

[April 11, 2008, 07:34:54 PM]

[April 11, 2008, 07:16:59 PM]
Theme switch

Powered by MySQL Powered by PHP Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.074 seconds with 28 queries.