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-07 (original capture). Home · Forum · All archived topics · Downloads
Warcraft-Source.com - WCS mod for CSS
April 07, 2008, 09:36:45 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Forum URL changed, please update your bookmarks!
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: !!help wanted!! cant find the problem with event order  (Read 84 times)
mobsi
Level 1 Trained Beginner
*
Offline Offline

Germany Germany

Posts: 26



« on: April 04, 2008, 10:05:38 PM »

well i m trying to make a skill that does that and that if you hit someone for the first time and something else if you hit him the second third fourth fifth etc. time

thats how far i came but all it does is changeing the enemys color to green (first skill event) and he does that to every enemy i shot no matter if i colored one green before or not :/
Code
GeSHi (eventscripts):
"player_spawn_cmd"  "es_setinfo nummer 0"
Code
GeSHi (eventscripts):
"skill1_setting" "0"
"skill1_cmd" "es_setinfo alive 0; es est_isalive alive event_var(userid);if (alive = 1) then racealias_nummerabfrage"
"racealias_nummerabfrage" "if (server_var(nummer) = 0) then racealias_n0n;if (server_var(nummer) = 1) then racealias_n1n;if (server_var(nummer) = 2) then racealias_n2n;es_xif (server_var(nummer) = 3) then racealias_n3n;es_xif (server_var(nummer) = 4) then racealias_n4n;es_xif (server_var(nummer) = 5) then racealias_n5n;es_xif (server_var(nummer) = 6) then racealias_n6n;es_xif (server_var(nummer) = 7) then racealias_n7n;es_xif (server_var(nummer) = 8) then racealias_n8n;es_xif (server_var(nummer) = 9) then racealias_n9n"
"racealias_n0n" "es est_setplayercolor event_var(userid) 0 255 0 255 1;es_setinfo nummer 1"
"racealias_n1n" "es est_setplayercolor event_var(userid) 255 0 255 255 1";es_setinfo nummer 2"
"racealias_n2n" "es est_setplayercolor event_var(userid) 0 255 255 255 1;es_setinfo nummer 3"
"racealias_n3n" "es est_setplayercolor event_var(userid) 0 255 0 255 1;es_setinfo nummer 4"
"racealias_n4n" "es est_setplayercolor event_var(userid) 255 0 0 255 1;es_setinfo nummer 5"
"racealias_n5n" "es est_setplayercolor event_var(userid) 0 0 255 255 1";es_setinfo nummer 6"
"racealias_n6n" "es est_setplayercolor event_var(userid) 255 100 0 255 1;es_setinfo nummer 7"
"racealias_n7n" "es est_setplayercolor event_var(userid) 100 255 0 255 1;es_setinfo nummer 8"
"racealias_n8n" "es est_setplayercolor event_var(userid) 255 0 110 255 1;es_setinfo nummer 9"
"racealias_n9n" "es est_setplayercolor event_var(userid) 0 255 0 255 1;es_setinfo nummer 0"
"skill1_sfx" "0"
 
Logged
kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1094



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« Reply #1 on: April 04, 2008, 11:14:58 PM »

why you posted this in shopitems section? 

your theory is good, but problem is this would only work if ONE have this race...because "number" is a global variable.
also, your if... is wrong

Code
GeSHi (eventscripts):
if (server_var(alive) = 1) then racealias_nummerabfrage

the you could code the numberquery also a better looking way: (but your code is ok, so use your code  )
Code
GeSHi (eventscripts):
"racealias_nummerabfrage" "if (server_var(nummer) in 0123456789) then es_xformat wcs_tmp racealias_n%1n;if (server_var(nummer) in 0123456789) then wcs_tmp"

but again, this doesn't work if other people select this race!!

instead of number, you need to do

spawn:
es_keysetvalue WCSuserdata event_var(userid) number 0

abfrage:
es_keygetvalue nummer WCSuserdata event_var(userid) number;if (server_var(nummer) .......

nXn:
es est_setplayercolor......;es_xmath nummer + 1;es_keysetvalue WCSuserdata event_var(userid) number server_var(nummer)

and on the n9n: (instead of math +1)
setplayercolor...;es_keysetvalue WCSuserdata event_var(userid) number 0

btw, nice idea :=)

and don't switch nummer and number...also, please try to use English variable names
« Last Edit: April 04, 2008, 11:16:39 PM by kryptonite » Logged

(click to show/hide)
mobsi
Level 1 Trained Beginner
*
Offline Offline

Germany Germany

Posts: 26



« Reply #2 on: April 05, 2008, 12:37:28 AM »

well first of all thx a lot =)
but is there any possibility to make the race usable for more then 1 player?
like using the the playername or even better the steamid to create the var?
« Last Edit: April 05, 2008, 12:40:49 AM by mobsi » Logged
kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1094



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« Reply #3 on: April 05, 2008, 10:10:49 AM »

yes, it is.
and I already explained it to you....

you need to modify several lines, eg.
es_setinfo nummer 0
-> es_keysetvalue WCSuserdata event_var(userid) number 0

means, you use keygroups instead of the variable nummer

you would have to replace the spawn, "racelias_nummernabfrage" and each racealias_nXn
Quote
spawn:
es_keysetvalue WCSuserdata event_var(userid) number 0

abfrage:
es_keygetvalue nummer WCSuserdata event_var(userid) number;if (server_var(nummer) .......

nXn:
es est_setplayercolor......;es_xmath nummer + 1;es_keysetvalue WCSuserdata event_var(userid) number server_var(nummer)

and on the n9n: (instead of math +1)
setplayercolor...;es_keysetvalue WCSuserdata event_var(userid) number 0
Logged

(click to show/hide)
mobsi
Level 1 Trained Beginner
*
Offline Offline

Germany Germany

Posts: 26



« Reply #4 on: April 05, 2008, 11:17:21 AM »

hmmm ok thx

if anyone is in the mood to explain how those keys work i'd be very thankful

greez mobsi
Logged
kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1094



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« Reply #5 on: April 05, 2008, 12:46:08 PM »

can you replace the commands with the keygroup commands? or need more help?

The keygroups are like personal variables, its looks like this:
Quote
"WCSuserdata"
{
  "userid"
  {
    "var" "value"
    "var2" "..."
  }
  "userid2..."
  { }
}

because of all variables are _global_ in ES, we need such player variables for more complicated skills.
Also the race, skill levels or skulls are saved in that keygroup.
Logged

(click to show/hide)
mobsi
Level 1 Trained Beginner
*
Offline Offline

Germany Germany

Posts: 26



« Reply #6 on: April 05, 2008, 06:07:24 PM »

and i can also create new ones?  with es_keycreate or such a command
Logged
kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1094



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« Reply #7 on: April 05, 2008, 08:47:23 PM »

yes, of course!!
check the ES wiki or forum to get more information.

WCS creates the key when a player connects:
es_keycreate WCSuserdata event_var(userid)

you can also create a whole new group:

es_keygroupcreate mygroup
es_keycreate mygroup event_var(userid)
...
Logged

(click to show/hide)
mobsi
Level 1 Trained Beginner
*
Offline Offline

Germany Germany

Posts: 26



« Reply #8 on: April 06, 2008, 11:22:41 AM »

so i got another question concerning keys

where can i see which keys already exists so that i dont have to create em?

E: another thing i d like to know is if i d create a new key when is the best point to do that?
    is it the preload_cmd or would it be better to recreate it every roundstart and delete it every roundend?
like
Code
GeSHi (eventscripts):
"preloadcmd"        "0"
"player_spawn_cmd"  "es_keysetvalue thekey whatever 0"
"round_start_cmd"   "es_keycreate thekey"
"round_end_cmd"     "es_keydelete thekey"
 

or

Code
GeSHi (eventscripts):
"preloadcmd"        "0"
"player_spawn_cmd"  "es_keycreate thekey;es_keysetvalue thekey whatever 0"
"round_start_cmd"   "0"
"round_end_cmd"     "es_keydelete thekey"
 


just 1 more thing i d like to know
does es_keysetvalue crates the values also or does it just use existing ones?

greez mobsi
« Last Edit: April 06, 2008, 01:02:37 PM by mobsi » Logged
kryptonite
<WCS coder>
Administrator
Level 7 Expert
*****
Offline Offline

Germany Germany

Posts: 1094



WWW
sp0nk

myServer 85.190.38.232:27015
(Warning: click connects through Steam)
« Reply #9 on: April 06, 2008, 04:26:51 PM »

you can run
es_keylist
or
es_keygrouplist
to show all key/keygroups.

WCS creates a few keys like WCSuserdata, or WCSsp, WCSpd... (spawn, player_death....for the shopitems)

you should create keys in "preloadcmd", this is only ran ONCE.

But if the key has something to do with the player, use player_spawn_cmd.

round_start/end is only good if you want to reset/erase keys every round. (eg. a roundcounter)
Logged

(click to show/hide)
Pages: [1]   Go Up
  Print  
 
Jump to:  

Last 7 Shouts:
Today at 06:19:22 PM
ok thx my |POWER|:-)
Today at 04:35:52 PM
i removed your topic and putt the Server in the list of official servers!!
Today at 01:39:08 PM
schaisse
Today at 01:07:15 PM
@ |POWER| Es ist ein offizieler Test server es ist nur kein Gesponsorter von Lowping net, wird aber von iXG für Testzwecke des mods zur verfügung gestellt und vom WCS Team Betreut = Offizieler Test server
Today at 01:06:13 AM
WCSP now supports keygroup style races! (0.7X)

~J3ff
April 06, 2008, 09:35:42 PM
Not official...
April 05, 2008, 11:08:54 PM
Hi@ll, new Official WCS Server (germany) http://warcraft-source.com/board/index.php/topic,3948.0.html
Recent
[Today at 08:53:06 PM]

[Today at 08:50:23 PM]

[Today at 08:47:17 PM]

[Today at 08:43:20 PM]

[Today at 08:30:33 PM]

[Today at 08:26:13 PM]

[Today at 08:25:41 PM]

by YaYo
[Today at 08:15:56 PM]

[Today at 08:02:47 PM]

[Today at 07:53:56 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.161 seconds with 26 queries.