Basic Questions

surprisesurprise Join Date: 2003-01-16 Member: 12382Members, Constellation
edited April 2005 in Scripting Discussion
<div class="IPBDescription">how to get the scripts running</div> question 1: can i have all my aliases and binds and **** in my config.cfg or do i have to put some of them into other files like autoexec.cfg?
id like to have it all in one file if it works

question 2: do aliases have to be declared in front of the part where they are used?
e.g.

alias bad_example "stop"------contrary to--------bind f12 "bad_example"
bind f12 "bad_example"----------------------------alias bad_example "stop"


hm, thats it for now i guess, got to get my scripts working >.<

::edit::
okay, and a perhaps not-so-basic-question

question 3: how can i produce output on my screen, so for example if i have my demoscript that lets me record up to 4 demos, it should print out which demo is going to be recorded now.
echo only prints to the console, any way to get what i want?

Comments

  • surprisesurprise Join Date: 2003-01-16 Member: 12382Members, Constellation
    edited April 2005
    hm, okay, after some fiddling i got it working :/
    maybe ill answer my questions myself so others that dont know the answer can find it here:

    question1 : yes, you can have all in your config.cfg if you like, as far as i know there is no need for a second file as long as you dont want to structure your scripts into several files

    question2:aliases are recognized everywhere, so aliases can be at the end of your configfile

    question3: thats a bit rough, i got it working, but i used some advanced commands
    the problem is that "echo" only prints to the console
    what we use is the "motd"-command
    it works like that:
    "developer 1" we need that one so that the following comands work
    "motdfile" selects the current in- and outputfile for motd-messages
    "motd_write" writes the given text to the file, that has been specified by motdfile
    "motd" will print the text in the file we selected into the upper left corner of the screen
    "developer 0" we turn developer off to prevent exploits and such

    now an example: we want to print a statusmessage:
    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    bind "F12""developer 1;motdfile echo.txt;motd_write Statusmessage;motd;developer 0"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
    this should print "Statusmessage" to your screen
    --------------------------------------------------------------------------
    what i needed that for:
    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    alias demotoggle "demo1"
    alias demo1 "stop;record demos\demo1.dem;op_demo1;alias demotoggle demo2"
    alias demo2 "stop;record demos\demo2.dem;op_demo2;alias demotoggle demo3"
    alias demo3 "stop;record demos\demo3.dem;op_demo3;alias demotoggle demo4"
    alias demo4 "stop;record demos\demo4.dem;op_demo4;alias demotoggle demoende"
    alias demoende "stop;op_demoend;alias demotoggle demo1"
    //
    alias op_demo1 "dev1;motdfile echo.txt;motd_write Demo 1 wird aufgenommen;motd;dev0"
    alias op_demo2 "dev1;motdfile echo.txt;motd_write Demo 2 wird aufgenommen;motd;dev0"
    alias op_demo3 "dev1;motdfile echo.txt;motd_write Demo 3 wird aufgenommen;motd;dev0"
    alias op_demo4 "dev1;motdfile echo.txt;motd_write Demo 4 wird aufgenommen;motd;dev0"
    alias op_demoend "dev1;motdfile echo.txt;motd_write Demos alle aufgenommen, Demos austauschen!;motd;dev0"
    //
    //Allgemeine ALias-Definitionen
    //
    //developer-switchen
    alias dev1 "developer 1"
    alias dev0 "developer 0"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
    op stands for OutPut

    a demoscript that records up to 4 demos and always tells you which demo you are recording at the moment
    when all 4 demoslots are full you are warned to create space for more demos

    i really like that one, you always know how many demos you can still take
  • BlueNovemberBlueNovember hax Join Date: 2003-02-28 Member: 14137Members, Constellation
    edited April 2005
    You can record unlimited demos using this script:
    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    alias demo "demo_prompt"
    alias demo_prompt "messagemode record; alias demo demo_stop"
    alias demo_stop "stop; speak exit; alias demo demo_prompt"
    bind x "demo"
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
    Where x is your demo recording key.

    Or just increase the max amount of demos by adding lines to your 4 demo script:
    <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->alias demo3 "stop;record demos\demo3.dem;op_demo3;alias demotoggle demo4"
    alias demo4 "stop;record demos\demo4.dem;op_demo4;alias demotoggle <span style='color:red'>demo5
    alias demo5 "stop;record demos\demo4.dem;op_demo4;alias demotoggle demoende</span><!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    ...and so on.

    *Cheeseh charasmatic voice*
    For all these tips and more check out the Demo tutorial <a href='http://www.unknownworlds.com/forums/index.php?showtopic=89270' target='_blank'>here</a>

    Edit:
    Your answer to question1 is wrong. You cannot put complex scripts in config.cfg, as they will be overwritten by steam. Use userconfig.cfg instead, and add "exec userconfig.cfg" to the end of config.cfg, if it is not there already.

    Btw surprise, wann werdest du mein PM antworten? <!--emo&:(--><img src='http://www.unknownworlds.com/forums/html/emoticons/sad-fix.gif' border='0' style='vertical-align:middle' alt='sad-fix.gif' /><!--endemo-->
  • surprisesurprise Join Date: 2003-01-16 Member: 12382Members, Constellation
    edited April 2005
    wirst <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin-fix.gif' border='0' style='vertical-align:middle' alt='biggrin-fix.gif' /><!--endemo-->
    now =)

    hm, i have my config in read-only mode, so it should not ever be overwritten, it works for me


    and the main reason why i want the script i use at the moment:
    i think about making a movie
    now ill take demos, and as soon as a scene took place that would be worth to be in the movie i can end the demo and start the next one
    so i know that at the end of every demo theres a good scene, thats all


    but if i think about it again, i can do the same with the messagemodescript >.<
    i think im going to try it out <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html/emoticons/wink-fix.gif' border='0' style='vertical-align:middle' alt='wink-fix.gif' /><!--endemo-->
Sign In or Register to comment.