Results 1 to 10 of 10

Thread: malfunctining script

  1. #1

    Default malfunctining script

    hey guys , iam trying to operate this script :
    Code:
       
    huddraw_virtualsize 101 1
    
      huddraw_align  101 right top
    
      huddraw_font   101 "verdana-12"
    
      huddraw_rect   101 -72 58 14 14
    
      huddraw_color  101 0 1 0
    
      huddraw_alpha  101 1.0
    
      huddraw_string 101 "Message"
    ik it display a certain "Message" in the aligned position , but i need to know what is the complete thread that is needed to make it work because if its added like that it wont work , and how can i make it moving in the screen or disappear and how can i align it in X Y Coordinates not Words right and left , etc ..

  2. #2
    Senior Member beroo's Avatar
    Join Date
    Dec 2017
    Location
    Cairo
    Posts
    108

    Default

    Quote Originally Posted by demonkirolos View Post
    hey guys , iam trying to operate this script :
    Code:
       
      huddraw_virtualsize 101 1
      huddraw_align  101 right top
      huddraw_font   101 "verdana-12"
      huddraw_rect   101 -72 58 14 14
      huddraw_color  101 0 1 0
      huddraw_alpha  101 1.0
      huddraw_string 101 "Message"
    ik it display a certain "Message" in the aligned position , but i need to know what is the complete thread that is needed to make it work because if its added like that it wont work , and how can i make it moving in the screen or disappear and how can i align it in X Y Coordinates not Words right and left , etc ..

    to active this message in ur server just execute it from DMprecache
    1- copy this script into .txt file then save it and change the formula to .scr then rename it to "Message" or as u want
    2- open DMprecache and type this line into [exec global/message.scr] at the end
    3- u shouldn't repeat the index in another huddraw script
    Code:
     huddraw_color  101  0 1 0
    this the red number is the index if u repeat it one of them will be overwrite the another one
    Note: the maximum index number is "255"
    4- if u want to make this message appear and disappear u need to add [while] to make this script when it finish run it again. it will be looks like that
    Code:
    main:
    while(1)
    {
    wait 10
    huddraw_alpha 10 1 // alpha
    huddraw_color 10 0 1 0 // color
    huddraw_font 10 "facfont-20" // font
    huddraw_align 10 center bottom // alignment
    huddraw_rect 10 -65 -20 100 20 // origin left
    huddraw_string 10 "Test1"
    
    wait 10
    huddraw_alpha 10 0
    wait 30
    
    huddraw_alpha 11 1 // alpha
    huddraw_color 11 0 1 0 // color
    huddraw_font 11 "facfont-20" //font
    huddraw_align 11 center bottom // alignment
    huddraw_rect 11 -65 -20 100 20 // origin left
    huddraw_string 11 "Test2"
    
    wait 10
    huddraw_alpha 11 0
    wait 30
    
    huddraw_alpha 12 1 // alpha
    huddraw_color 12 0 1 0 // color
    huddraw_font 12 "facfont-20" //font
    huddraw_align 12 center bottom // alignment
    huddraw_rect 12 -65 -20 100 20 // origin left
    huddraw_string 12 "Test3"
    
    wait 10
    huddraw_alpha 12 0
    wait 30
    
    huddraw_alpha 13 1 // alpha
    huddraw_color 13 0 1 0 // color
    huddraw_font 13 "facfont-20" //font
    huddraw_align 13 center bottom // alignment
    huddraw_rect 13 -65 -20 100 20 // origin left
    huddraw_string 13 "Test4"
    
    wait 10
    huddraw_alpha 13 0
    wait 30
    
    huddraw_alpha 14 1 // alpha
    huddraw_color 14 0 1 0 // color
    huddraw_font 14 "facfont-20" //font
    huddraw_align 14 center bottom // alignment
    huddraw_rect 14 -65 -20 100 20 // origin left
    huddraw_string 14 "Test5"
    
    wait 10
    huddraw_alpha 14 0
    wait 30
    
    huddraw_alpha 15 1 // alpha
    huddraw_color 15 0 1 0 // color
    huddraw_font 15 "facfont-20" //font
    huddraw_align 15 center bottom // alignment
    huddraw_rect 15 -65 -20 100 20 // origin left
    huddraw_string 15 "Test6"
    
    wait 10
    huddraw_alpha 15 0
    wait 30
    
    huddraw_alpha 16 1 // alpha
    huddraw_color 16 0 1 0 // color
    huddraw_font 16 "facfont-20" //font
    huddraw_align 16 center bottom // alignment
    huddraw_rect 16 -65 -20 100 20 // origin left
    huddraw_string 16 "Test7"
    
    wait 10
    huddraw_alpha 16 0
    wait 30
    
    huddraw_alpha 17 1 // alpha
    huddraw_color 17 0 1 0 // color
    huddraw_font 17 "facfont-20" //font
    huddraw_align 17 center bottom // alignment
    huddraw_rect 17 -65 -20 100 20 // origin left
    huddraw_string 17 "Test8"
    
    wait 10
    huddraw_alpha 17 0
    wait 30
    
    huddraw_alpha 18 1 // alpha
    huddraw_color 18 0 1 0 // color
    huddraw_font 18 "facfont-20" //font
    huddraw_align 18 center bottom // alignment
    huddraw_rect 18 -65 -20 100 20 // origin left
    huddraw_string 18 "Test9"
    
    wait 10
    huddraw_alpha 18 0
    wait 30
    
    huddraw_alpha 19 1 // alpha
    huddraw_color 19 0 1 0 // color
    huddraw_font 19 "facfont-20" //font
    huddraw_align 19 center bottom // alignment
    huddraw_rect 19 -65 -20 100 20 // origin left
    huddraw_string 19 "Test10"
    
    wait 10
    huddraw_alpha 19 0
    }
    wait 30
    end
    Note: if u want to make the text appear fast or slow change the number after "wait"
    5- if u want to know how u can move the text read this
    huddraw_align <index> <horizontal> <vertical>
    This sets the alignment of the huddraw element.
    Valid values for horizontal alignment are "left", "center", and "right".
    Valid values for vertical alignment are "top", "center", and "bottom".


    huddraw_rect <index> <X position> <Y position> <width> <height>
    This sets the position and size of the huddraw element. X and Y specify the position of
    the upper left corner position. Higher values of X move it to the right, and higher
    values of Y move it down. When you set the alignment, the XY position specified is
    relative to that alignment. For example, if you align it to the right edge of the hud,
    the X position should be less than zero so that it the upper left corner will be brough
    back to the left onto the screen.

    huddraw_virtualsize <index> <virtual>
    This let's you set the huddraw element's size and position according to a virtual screen
    resolution of 640x480. What this means is that it lets you treat the hud like it's always
    at 640x480, and it will be properly resized and positioned according to the actual resolution.

    huddraw_color <index> <red> <green> <blue>
    This set the color of the huddraw element. Each color channel should be between 0 and 1.

    huddraw_alpha <index> <alpha>
    This set the alpha of the huddraw element. It should be set between 0 and 1. This is also
    used to turn off a huddraw element that is no longer wanted by setting the alpha to 0.

    huddraw_string <index> <string>
    This sets the huddraw element to display a string instead of a shader graphic. The size
    of the font can not be adjusted, but the color and alpha settings do affect the text.
    The width and height parameters of huddraw_rect are only used for alignment centering,
    Not for setting the size of the string.

    huddraw_font <index> <fontname>
    This sets the font for a string displaying huddraw element to use. The names of available
    font can be gotten from the game/main/fonts folder. The file names of the .ritualfont files
    in there are the names used for the fonts.
    Last edited by beroo; September 30th, 2018 at 04:47 PM.
    Greetings :-{[T_P]}- BeroO -{[CF]}-
    the-pharaohs.enjin.com

  3. #3
    Senior Member Ancient Order's Avatar
    Join Date
    Aug 2015
    Location
    Paris, Fr.
    Posts
    256

    Default

    Quote Originally Posted by beroo View Post
    1- copy this script into .txt file then save it and change the formula to .scr then rename it to "Message" or as u want
    just in case you dont know, you can have any extension you want, i always keep it as .txt so it opens on a click.
    For any hud element you add, just huddraw it once every time a player connects to the server and basta, no need to consume cpu and server upload by loooping it every frame. If the message has to change during level time, just loop huddraw_text/ihuddraw_text.

  4. #4

    Default

    i tried three diffrent things :

    1- adding my own code to a pk3 contains global/message.scr then adding to my precache exec global/message.scr
    2- adding my own code to folder global in main with remaining the exec command in the precache
    3- removing my code and adding bero's Loop and neither of these rang a bell may i upload the pk3 that contains the script and some1 check it for me for i may have done somthing wrong?

  5. #5

    Default

    Quote Originally Posted by Ancient Order View Post
    just in case you dont know, you can have any extension you want, i always keep it as .txt so it opens on a click.
    For any hud element you add, just huddraw it once every time a player connects to the server and basta, no need to consume cpu and server upload by loooping it every frame. If the message has to change during level time, just loop huddraw_text/ihuddraw_text.
    oh ! when i tried to edit a scr file i needed to convert it to txt then to scr again i didnt know really i could leave a scr file as txt and it will work as well ^^ it just made me hate editing scr files

  6. #6
    Senior Member beroo's Avatar
    Join Date
    Dec 2017
    Location
    Cairo
    Posts
    108

    Red face

    Quote Originally Posted by Ancient Order View Post
    just in case you dont know, you can have any extension you want, i always keep it as .txt so it opens on a click.
    For any hud element you add, just huddraw it once every time a player connects to the server and basta, no need to consume cpu and server upload by loooping it every frame. If the message has to change during level time, just loop huddraw_text/ihuddraw_text.
    i was use huddraw script as scr , i didn't know the server will upload it every frame and this will effect on every player,and i change it in my server too and working very well ty for this advice @ancient

    Quote Originally Posted by demonkirolos View Post
    i tried three diffrent things :

    1- adding my own code to a pk3 contains global/message.scr then adding to my precache exec global/message.scr
    2- adding my own code to folder global in main with remaining the exec command in the precache
    3- removing my code and adding bero's Loop and neither of these rang a bell may i upload the pk3 that contains the script and some1 check it for me for i may have done somthing wrong?
    then upload it and post the line in the DMprecache may we will know why it isn't work (did u try to change the index as i said to u if u repeat it one of them will work )

    Quote Originally Posted by demonkirolos View Post
    oh ! when i tried to edit a scr file i needed to convert it to txt then to scr again i didnt know really i could leave a scr file as txt and it will work as well ^^ it just made me hate editing scr files
    i'm using notepad++ program which can edit on scr files without change it to txt try to use it if u don't have it
    Greetings :-{[T_P]}- BeroO -{[CF]}-
    the-pharaohs.enjin.com

  7. #7

    Default

    http://www.mediafire.com/file/2cbpi8...sages.pk3/file execution from precache : exec global/message.scr

  8. #8
    Senior Member beroo's Avatar
    Join Date
    Dec 2017
    Location
    Cairo
    Posts
    108

    Default

    Quote Originally Posted by demonkirolos View Post
    http://www.mediafire.com/file/2cbpi8...sages.pk3/file execution from precache : exec global/message.scr
    Click image for larger version. 

Name:	Capture.jpg 
Views:	49 
Size:	40.3 KB 
ID:	1997
    It's worked with me try search if u have more than one DMprecache if u found another one combine it in one file and try to use this file
    Attached Files Attached Files
    Greetings :-{[T_P]}- BeroO -{[CF]}-
    the-pharaohs.enjin.com

  9. #9

    Default

    ik this kinda error , which is each mod i dl has its own dm precache , that's why i added all exec compand to my custom precache but we may say , it may interupt another mod uses same kind of hud message?

  10. #10

    Default

    When you add a mod with something to show on the screen you have to be carefull because if he uses the same huddraw index like the other, the first mod will not work because the second will overwrite the first.

    To have the two working together you need to put in different numbers.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •