Using quotation marks in binds -1 reply

Please wait...

El Dragon

Wild West Mod

50 XP

25th June 2003

0 Uploads

2,523 Posts

0 Threads

#1 15 years ago

Got a forwarded email from Iggy:

Ok, now I got one question. Iam a bit confused about using quotation marks.

Example: I want to define a varible k_bind which contains the commandline bind k "echo first; echo second"

(So that after this 'vstr k_bind' defines the binding "echo first; echo second" for k.)

I tried this: set k_bind "bind k "echo first, echo second"" but it doesnt work in this way.

I could solve my problem using a dummy: set k_dummy "echo first; echo second" set k_bind "bind k vstr k_dummy"

But its an ugly solution and it makes the code more unreadable. Isnt it possible to use interlaced quotation-marks?

Thx for replying, Rudi

and here's my responce: k first of all, I've found by trial and error that you can only stick one echo OR say command in a line. If you want to do more than one (or one of each) then do the following bind KEY "vstr msg1;wait ##;vstr msg2;wait ##;vstr msg3" then set msg1 "echo bla bla" set msg2 "echo ^1bla ^1bla" // note you need a color stroke after any and all spaces in an echo or it reverts to white set msg3 "say all done" or as aboveset k_bind "bind k "echo first, echo second""

//would be better done like this: set k_bind "bind k vstr first;wait 20;vstr second" set first "echo first" set second "echo second" You will need to exparament on the wait time it's based on your fps, high fps will need a longer wait or a command may not be exicuted. As to multiple quotes I've seen folks do it but it's very sloppy code. The program reads commands as follows: ACTION NAME "WHAT TO DO" If you start adding multiple quotes like this: ACTION NAME "WHAT" TO" DO""" then you might get a strange responce with any part of the quoted area being dropped or misinterpreted like: ACTION NAME "WHAT" ACTION NAME "WHAT DO" or something else. P.S. I'd recomend that if folks have questions about scripting or anything else to please post them in forums. This will allow the following: Allow any and all that know the answer to post it. Allow others who may have (now or later) the same question to find it. Also to note when entering in 'code' I recomend using the code button (looks like this [#] this will insert an open/close code tag then put code/scripts in that.




DEADEYE

Wild west mod of RTCW

50 XP

23rd April 2003

0 Uploads

3,213 Posts

0 Threads

#2 15 years ago

when i was in a clan in 2000 playing ctf...i had been taught how to bind sof1 keys..eg 2 enemy in coming.....enemys are at our base, need back up,but with rtcw iam not sure wheather to go into my mp_cfg....and lay the binds there..perhaps when some one can find the time ..maybe some day give new players a how to bind well .page.......as the info can mean win or lose maybe ....like i have all the shrub binds , / bind h grenades /bind x + salute ....but id like color binds with critical info.....but my color genarator in a name maker ,then you .drop it in ur main .~ /exec aname.cfg ..so i couldn,t see it working well for color binds.... thanks el dragon great topic :naughty:




El Dragon

Wild West Mod

50 XP

25th June 2003

0 Uploads

2,523 Posts

0 Threads

#3 15 years ago

@ win (and others) I recomend putting all your custom binds and scripts in a separate file than the wolfconfig_mp file. This will allow you to call up all commands quickly (even send/bring them to another machine if your traveling) or allow more than one person to have their own custom bind/script sets/preferences. Also should you have to reinstall software you still have you custom stuff. and from rudi (who should be able to find the forums now)

But therefore an additional question: How can I print out (echo) more than one spaces between two words?

I know: /echo bla bla output: bla bla (only one space will be printed)

/echo "bla bla" output: bla bla (ok)

But how can I define a varible which contains the last echo-commandline? Are there an easier solution than this one?: set msg "echo bla ^7 ^7 ^7 ^7 ^7 ^7 bla"

(I need this for formatting a quick-chat-menu which I have written.)

This I'm not sure, I know that echo messages like html will drop extra spaces so you're solution with the ^7 might work, only safe way is trial and error and test.

I ve read that wait-commands are necessary between commands whose takes a while to execute (like vsay or weaponbank). Here it works to use echo and say instructions in a line - without a wait between!!

> bind KEY "vstr msg1;wait ##;vstr msg2;wait ##;vstr msg3" > set msg1 "echo bla bla" > set msg2 "echo ^1bla ^1bla" > msg3 "say all done"

Exactly this example is working here without using wait-commands:

bind o "vstr msg1;vstr msg2;vstr msg3" set msg1 "echo bla bla" set msg2 "echo ^1bla ^1bla" set msg3 "say all done"

What is the reason that its working for me but not for you? - Maybe some another environment-varible which is setted in your wolfconfig_mp.cfg? (I got no probs using my own and default config.) - Is my FPS so low that a wait## isnt necassary (90FPS)? (Maybe the default waiting-time between two commands is 1 frame. What is your exactly wait-value which you needed at least for this example? ) - different wolfmp Versions? Iam using wolfrmp_linux_1.41 (I think linux- and M$-version shouldnt distinguish in this case)

as to you're machine not needing wait commands maybe you're frames rate is fast enough to not need them, but always good to have them in there. My frame rate currently is around 10-30 fps so if I don't have it wait long enough then some commands are missed. But I know that you need the apropriate time change in fps for a weapon change or nade delay script....




Rudi_alias_Rudi

I want to be like the Admins

50 XP

29th March 2004

0 Uploads

258 Posts

0 Threads

#4 15 years ago

El Dragon ... as to you're machine not needing wait commands maybe you're frames rate is fast enough to not need them, but always good to have them in there. My frame rate currently is around 10-30 fps so if I don't have it wait long enough then some commands are missed.[/QUOTE]

Ok, but there must be a default waiting time - maybe "wait 1". And a "wait 1" with low FPS takes longer time than with high FPS. So your computer should have more (absolute) time than my for executing a command even wthout a "wait #". Furthermore the examples above and even more complex scripts are working on my slow computer(15-20FPS, PII350, voodoo3) without using wait commands too.

So Ive got 2 considerations for this phenomen. 1st: It could be that the necessity of wait's depends on the COMBINATION of graphic-power and CPU-power. (So on a computer with _relatively_ slow CPU but _relativlely_ fast FPS a command like echo will not be executed completely until the next frame is calculated.) or 2nd: Maybe the linux-game-engine is a bit better in this case.

My problem is now - I wrote a script (player-selection, quickchat-menus) which isnt working on some computers but on my. Iam sure I have simply to add some wait's but I cannot guess the right places by trial and error because its working here without problems.

If you have a bit time - I could send you this script to make it working on your machine so that I can imagine where are the problems and fix it for other people.

Additionary I think that even sometimes a "wait" is necassary after a simply set-command if it is very long. (It seems that a few varibles are not defined correctly after executing my script on Bigus' machine.)

[QUOTE=El Dragon] But I know that you need the apropriate time change in fps for a weapon change or nade delay script....

Yes, but Iam still a bit confused about using wait, look at this example: Its well known that you have to use "wait" between commands like "weapon". So this will NOT be working: weapon 1; weapon 2

But this works!: weapon1; echo blabla

It seems that "weapon" isnt jamming ALL other commands.

This example is working too. weapon1; echo blabla; wait 200; weapon 2

Consider the long "wait" inst required in cause of the "echo" but in cause of the "weapon" before "echo".

thx for your interest, Rudi




El Dragon

Wild West Mod

50 XP

25th June 2003

0 Uploads

2,523 Posts

0 Threads

#5 15 years ago

k the reason for this is the following: you can echo (or say) something while the other weapon is being 'drawn out' (swaped with previous one) but if you were to exicute any other actions (fire/stop firing, zig zag, etc. ) then they would be skipped over until the first action (in this case swaping to weapon) was done. If you have low fps 7-20 like me, then you only need a wait 20 command to make sure the action is complete. If you had a fast machine (high fps) then you'd need a longer wait command (to cover the same time duration) lets say you have an action that takes 1 second to execute (I'll use a tell target script for example) the following results will happen for this script: set bang "+attack;tell_target ^3 =>BANG<=;wait 20;-attack :) now on my system with a low fps I'd get about one second's worth of shots (short burst RtCW or 1-2 shots WW) and the target and I would see a '=>BANG<= in our text areas. :uhm: now if someone with a medium speed system say fps of 40-50 they may get a 1/2 second's time limit of shots and the bang message or... :uhoh: now the dude with the really nice system and high fps is in trouble. the wait command is way too short for the tell target command to finish and he'll get the following (same as a script with a +attack but no -attack) he'll continuously keep firing until he runs out of bullets, then switch to pistol and blow through that ammo, then switch to a bomb that will start ticking. now a bomb with out a -attack command will stay in your hand until it's time limit will expire then...... This is probably what's happening with you folks, certain actions are being missed because the system has a different (probably higher) frame rate (fps) btw, the above example (with messy results) was actually done by you'res truely during one exparamental night on one of the gaminguk servers. (we had several of us blowing up trying to figure out why we weren't getting the results we expected) So a note to all scripters, test it out before making it a permanant part of your cfg file. My auto reloader for musket became an auto reload after single shots FOR ANY weapon and was almost imposible to remove for some reason. (also why you should keep backups of your wolfconfig files from default on...)