Urban Terror Forums: Script Repository - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • This topic is locked

Script Repository Rate Topic: ***** 1 Votes

#21 User is offline   Nexu Icon

  •   clan leader   
  • Account: nexu
  • Main tag: |it|
  • Country:
  • Joined: 26-June 07
  • Posts: 4,265

Posted 19 August 2011 - 09:32 AM

vstr only accept 1 argument. Making it more press-to-toggle functionality.
set sample_var "ut_echo Hello world"
bind x "vstr sample_var"


Player press key x and the text "Hello world" will be displayed

+vstr accepts 2 arguments. Allow it for press-and-hold-toggle functionality.
set sample_var1 "ut_echo Hello"
set sample_var2 "ut_echo World"
bind x "+vstr sample_var1 sample_var2"


Player press key x and the text "Hello" will be displayed the moment the key is pressed, the text "World" will be displayed when the key x is released.

Note: vstr and +vstr requires variables as argument. Meaning "vstr ut_weaptoggle" will not work since ut_weaptoggle is not a variable but a command. To make this example work, you need to store the command in a variable:

set cf.weaptoggle "ut_weaptoggle"
bind x "vstr cf.weaptoggle"


(p.s.: I uses the prefix cf. to distinguish the variables i made for scripting, allowing for easier debugging in the console with TAB-completion)

#22 User is offline   MajkiFajki Icon

  •   former FS member   
    Mapper
  • Account: majkifajki
  • Country:
  • Joined: 11-January 11
  • Posts: 1,583

Posted 19 August 2011 - 12:26 PM

@Nexu

I'm using weapotoggle bind:

bind MOUSE2 "ut_weaptoggle sidearm secondary"


No matter what I set, when I click mouse2 after respawn, I always select SECONDARY (having primary selected by default).


Any idea? :rolleyes:

#23 User is offline   Nexu Icon

  •   clan leader   
  • Account: nexu
  • Main tag: |it|
  • Country:
  • Joined: 26-June 07
  • Posts: 4,265

Posted 19 August 2011 - 12:36 PM

But if you press MOUSE2 again, does it go to sidearm?

And consequently, if you press MOUSE2 once again. Will it go to secondary?

#24 User is offline   MajkiFajki Icon

  •   former FS member   
    Mapper
  • Account: majkifajki
  • Country:
  • Joined: 11-January 11
  • Posts: 1,583

Posted 19 August 2011 - 12:39 PM

Yes Nexu, It works ok.

But I want to have it in order I set - sidearm then secondary. Currently it always start "cycle" with secondary. After that weapons switch ok.

#25 User is offline   Delirium Icon

  •   QA member   
  • Account: delirium
  • Country:
  • Joined: 28-February 10
  • Posts: 5,416

Posted 20 August 2011 - 01:44 AM

//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
//		DaNcE Script
//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
bind = "vstr dance0"			//Bind Key for DaNcInG
seta dance0 "vstr dance1; vstr dance2; vstr dance3"
seta dance1 "say_team ^2DaNcE; cl_pitchspeed 1000; cl_yawspeed 5000; +movedown; +left; +lookdown; wait 100; vstr !dance2"
seta dance2 "-movedown; +moveup; wait 12; -moveup; -lookdown; +lookup; wait 153"
seta dance3 "-lookup; -left; wait 21; cl_pitchspeed 100; cl_yawspeed 100; centerview"

Dancing button

//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
//		Sensitivity Script
//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
set do_shooting_on "+attack; sensitivity 0.7;cl_pitchspeed 70;cl_yawspeed 100"
set do_shooting_off "-attack; sensitivity 1;cl_pitchspeed 100;cl_yawspeed 100"
bind mouse1 "+vstr do_shooting_on do_shooting_off"

Changed Sensitivity while you shoot


//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
//		Sound Toggle
//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
bind F8 "vstr sound_toggle"
seta sound_toggle "vstr sound_off"
seta sound_off "set sound_toggle vstr sound_on; s_volume 0; s_musicvolume 0; ut_echo ^7sound turned ^1OFF"
seta sound_on "set sound_toggle vstr sound_off; s_musicvolume 0.281250; s_volume 1.416666; ut_echo ^7sound turned ^2ON"

Turning sound on and off

//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
//		Ironsight Script
//~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
set shooting_on2 "sensitivity 0.3; cg_fov 90"
set shooting_off2 "sensitivity 0.4; cg_fov 110"
bind mouse2 "+vstr shooting_on2 shooting_off2"

Iron sight

This post has been edited by Delirium: 20 August 2011 - 01:46 AM


bullet_loaderAdvertisement

#27 User is offline   weedles64 Icon

  • Account: weedles64
  • Joined: 26-August 11
  • Posts: 2

Posted 26 August 2011 - 03:04 AM

Hey I dont know if this will help any but I am working on a script i will post tomorrow. Its just binds. I compiled a bunch of concepts from other peoples scripts that i have seen. It is a weapon script and it will:
// obviously this is NOT the script its a description of what it does
bind <key> toggle crosshair color
bind <key> toggle crosshair size
bind <key> toggle crosshair type
bind <key> toggle scopering type
bind <key> toggle scoprgb
bind <key> primary secondary toggle
bind <key> FOV
-zoom in
-change field of vision
-change sensitivity
-toggle show hands
-change crosshair to that dot type and make it 10 pixels
bind <scroll with mouse> scope zoom
bind <key> grenade script
-switches to grenades
-throws grenade
-switches back to primary
bind <key> toggle Custom Weapon Classes
-each has own name
-each is own gear set
-each has default crosshair type and size and color
bind <key> knife script
-switch to knife
-switch to throwing mode
-throw the knife
-switch back to primary
bind <key> switch to pistol

#28 User is offline   bl00dlus7 Icon

  • Account: bl00dlus7
  • Main tag: /Y.g.P/
  • Country:
  • Joined: 01-September 11
  • Posts: 22

Posted 07 September 2011 - 05:36 AM

set do_zoom_on                    "ut_zoomin   ; vstr fov_small"
set do_zoom_off                   "ut_zoomreset; vstr fov_wide"
set fov_small                     "cg_fov 90   ; cg_drawCrosshair 13; cg_crosshairSize 15"
set fov_wide                      "cg_fov 110  ; cg_drawCrosshair 13; cg_crosshairSize 15"
bind MOUSE2                       "+vstr do_zoom_on do_zoom_off" 


I can't get it to work......console says
+vstr <variablename1> <variablename2>: execute a variable command on key press and release


#29 User is offline   Runamok Icon

  • Account: runamok
  • Main tag: -WAR-
  • Country:
  • Joined: 01-March 10
  • Posts: 472

Posted 07 September 2011 - 01:30 PM

oh, I remember getting this error a long time ago, I don't remember exactly what it is, but there's a typo somewhere, make sure you have everything typed exactly right
-WAR-Runamok`

cyrus: "Camping" is a non-issue for a player that uses his/her head.

#30 User is offline   klabauterman Icon

  • Account: klabauterman
  • Main tag: aI|
  • Country:
  • Joined: 28-February 10
  • Posts: 245

Posted 15 September 2011 - 10:31 PM

I think the problem with +vstr was that it breaks when you use another variable (vstr) at the same time and the second argument is not executed
I forgot who was first to point that out, I guess it was Nexu or Obscure.
Solution to the script above is to merge fov_ into do_.

View PostMerkyMerc, on 25 December 2010 - 07:02 PM, said:

A lot of my scripting inspiration comes from DesRat (I miss that site so much :(


I just needed it myself. Desrat is not gone: it was crawled by the Wayback machine on February 2, 2011 the last time (see here).


  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Sponsored link
https://www.frozensand.com/


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942