Xonotic Forums
toggle help.. - Printable Version

+- Xonotic Forums (https://forums.xonotic.org)
+-- Forum: Support (https://forums.xonotic.org/forumdisplay.php?fid=3)
+--- Forum: Xonotic - Configuration Tips (https://forums.xonotic.org/forumdisplay.php?fid=19)
+--- Thread: toggle help.. (/showthread.php?tid=4017)



toggle help.. - _|'Ev|on - 03-20-2013

hi Smile

"pcolor1 = script"
alias +pcolor1 "pcolor1_on"
alias -pcolor1 "pcolor1_off"
alias pcolor1_on "+pcolor1"
alias pcolor1_off "-pcolor1"
---
alias +pcolor1 ""
alias -pcolor1 "pcolor1_off"
alias pcolor1_off "alias -pcolor1 pcolor1_on"
alias pcolor1_on "alias -pcolor1 pcolor1_off"
bind b "+pcolor1"

i need a toggle like this one
but i'm a noob on toggle create..

can you tell me what I'm doing wrong Huh

edit:
just waht i want is a turn off command
exemple script
alias pcolor1 "color X X; defer X.X pcolor2"
alias pcolor2 "color X X; defer X.X pcolor1"
pcolor1 = on
off = ?? Smile


RE: toggle help.. - asyyy - 03-20-2013

Quote:alias +pcolor1 "pcolor1_on"
alias -pcolor1 "pcolor1_off"
alias pcolor1_on "+pcolor1"
alias pcolor1_off "-pcolor1"

[Image: genius.jpg]

Eventually you want to create an alias with prior/default values.


RE: toggle help.. - _|'Ev|on - 03-20-2013

I do not know how I interrupt the infinite loop
and I'm a noob with toggles ..


RE: toggle help.. - Mr. Bougo - 03-20-2013

I really don't know what you are trying to do. You want to have pcolor1 and pcolor2 be executed alternatively in a loop, and you also want a way to stop the looping, is that right?

Code:
alias pcolor1 "color X; defer 2 pcolor2"
alias pcolor2 "color Y; defer 2 pcolor1"
alias pcolor_stop "defer clear"
This will clear every defer command waiting, though.

OR:

Code:
set pcolor_continue 0
alias pcolor1_0 ""
alias pcolor2_0 ""
alias pcolor1_1 "color X; defer 2 pcolor2_${pcolor_continue}"
alias pcolor2_1 "color Y; defer 2 pcolor1_${pcolor_continue}"
alias pcolor1 "pcolor_continue 1; pcolor1_1"
alias pcolor_stop "pcolor_continue 0"
This will still do the next pcolor after you do pcolor_stop. It can be avoided but you'll need two more aliases then.

EDIT: You seem to think that there's something special about +/- aliases. That is only true if you bind them to a key: if you bind +foo to space, then +foo is executed when space is pressed down, and -foo is executed when space is depressed.


RE: toggle help.. - _|'Ev|on - 03-20-2013

thx mr. bougo Smile
"defer clear" thats waht i search

---
alias pcolor1 "color X X; defer X pcolor2"
alias pcolor2 "color X X; defer X pcolor1"
alias pcolor1_on "pcolor1"
alias pcolor1_off "defer clear"
---


RE: toggle help.. - Mr. Bougo - 03-20-2013

Note that it clears everything in defer, so you can't use two such loops at the same time or defer clear will stop both.


RE: toggle help.. - _|'Ev|on - 03-21-2013

I still have a question
on the console, you can not "color 15 15" I guess
but it must indeed be an entry in a file
could you give me a tip where to start I have to look for


RE: toggle help.. - Mr. Bougo - 03-21-2013

What do you mean? You can use "color X Y" with X and Y between 0 and 15.

Can you explain what you want to do and why it does not work?


RE: toggle help.. - _|'Ev|on - 03-22-2013

sry i mean i cant change the speed "color 15 15" ...
can i edit the speed on a xonotic file ?
if so where can I start looking?


RE: toggle help.. - Mr. Bougo - 03-22-2013

Is color 15 15 the one that gradually changes color? You can't change how fast that goes.


RE: toggle help.. - _|'Ev|on - 03-22-2013

ok thx for the info Smile