UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Conbini2017

I think the error is due to you not putting: #using scripts\zm\_zm_utility; at the top of the code where it's supposed to go.

Here's some code:
Code Snippet
Plaintext

function damagebox() {
trigger = GetEnt("damagebox", "targetname");
trigger SetHintString("");
trigger SetCursorHint("HINT_NOICON");
while(1) {
wait(2);
players = getplayers();
for( i=0;i<players.size;i++ )
{
if(players[i] isTouching(trigger))
{
players[i] DoDamage(15,players[i].origin);
}
}
}
}
I will try it at once. :)
How can I do with radiant?
What is it, trigger?
Is entity info better to write script_sound and script_label?
please tell me. Please.
7 years ago
Code Snippet
Plaintext
//A comment is //comment. Compiler skips code with //
#using scripts\zm\_zm_utility; //use a script outside of current scope
while(1) { //loop begin. Run code while true. If 1 becomes zero loop stops.
ent = GetEnt("ent","targetname"); //locates an object named "ent". Make this a script_struct or script_origin
zm_utility::play_sound_at_pos("a_sound", ent.origin);  // play sound with name "a_sound" at the object
if (break_out_of_loop) {break;} //clause to stop the sound if necessary
wait(insert_sound_length_here); //ex. wait(3) stops code for 3 seconds
} //loop end



Put code in function. Run function with thread functionname()
I encountered such an error.
Code Snippet
Plaintext
^1}
^1^
^1ERR(0) scripts/zm/zm_test.gsc (269,1)  : syntax error, unexpected $end, expecting TOKEN_RIGHT_CURLY : }
Would you please show me an example script you actually used on the map?
7 years ago


I created main_olympia_anim.xmodel_export with maya and tried it exactly as shown in the tutorial video, but it is such a model.
7 years ago
did you export them like ADS anims? cause if so that is the issue. You must export them like normal anims (tag_torso,tag_cambone,hierarchy)
Thank you!! :D
7 years ago
Ads fire does not work properly. :(
Did we have a bad way of exporting maya?
7 years ago
Not necessarily. You could make the zone trigger a script but the OP didn't specify. I find it easier to use a trigger.
My example didn't explain how to trigger the code. It's easy enough to figure out.
Could you tell me how to use the zone?
7 years ago
You can toggle Wireframe display and highlight by pressing "J" and/or "Shift+J"
Thank you very much! :D
7 years ago
My Radiant does not have a wireframe display of models and walls.

7 years ago
Thank you very much
How (break_out_of_loop) {break;} is used?
7 years ago
Because I do not understand script at all,
please tell me in detail. :(
7 years ago
The first frame of ads down and the last frame of ads up animations define the position of the gun. So as long as you convert them properly everything will ne fine.
How can I leave only the last frame?
7 years ago
In the remake map of bo1 I would like to import waw weapons, but the first person does not fit in the weapon view model.


This is waw first person.
7 years ago
Some people get offended by this, but please know I mean no offense:

Here are some tips to clean up your code, make it more readable, and dynamic:

Code Snippet
Plaintext
function openDoor()
{
     level.door = GetEnt("door", "targetname");//I personally would pass the door, and not use a level var

     // level.trig1 = GetEnt("trigger1", "targetname");
     // level.trig2 = GetEnt("trigger2", "targetname");
     // level.trig3 = GetEnt("trigger3", "targetname");

     //instead of three level trigs above give them all the same targetname and do this
     trigs = GetEntArray("triggers","targetname");


     level.doorClip = GetEnt("door_clip", "targetname");//I personally would set the clip as the doors target and not use level var
     //need to disconnect paths on the door so zombies don't try to go through
     level.doorClip DisconnectPaths();//may not see this issue if no other way in that area

     level.buttonsNeeded = trigs.size;//set this to the number of trigs by using array size
     // level.buttonsPressed = 0;//we can comment this out and just use buttons needed and subtract

     // thread Trig1();
     // thread Trig2();
     // thread Trig3();

     //instead of threading the same function with a different name on each different trigger
     //you can thread on the array, or iterate the array and thread on each trigger

     //iterate method:
     foreach(trig in trigs)
     {
          trig thread Trig1();//I personally would pass the door, and not use a level var
     }

     //thread_all method:
     // array::thread_all(trigs, &Trig1);//this method requires adding #using scripts\shared\array_shared; to top

}

function Trig1()//I personally would pass the door, and not use a level var
{
     //you should set the hint here
     self SetCursorHint("HINT_NOICON");
     self SetHintString("Press [{+activate}] to...");

     // while(1)//no need for a while loop when you are breaking unconditionally
     // {
     self waittill("trigger", player);//self is the trigger, and player isn't used, so not really needed
     level.buttonsPressed--;//subtract so we can check < 0 later
     self Delete();//self delete
     CheckDoor();
     // break;
     // }
}
//no need for multiple functions that do the same function
// function Trig2()
// {
//      while(1)
//      {
//      level.trig2 waittill("trigger", player);
//      level.buttonsPressed++;
//      level.trig2 Delete();
//      CheckDoor();
//      break;
//      }
// }

// function Trig3()
// {
//      while(1)
//      {
//      level.trig3 waittill("trigger", player);
//      level.buttonsPressed++;
//      level.trig3 Delete();
//      CheckDoor();
//      break;
//      }
// }

function CheckDoor()//I personally would pass the door, and not use a level var
{
     // if(level.buttonsPressed >= level.buttonsNeeded)//check if >= instead of == just incase something bugs
     if(level.buttonsNeeded<=0)//changed this to check for less than 0 since now we will subtract
     {
          level.doorClip ConnectPaths();
          level.door Delete();
          level.doorClip Delete();
     //when you open a door, you'll need to connect the paths, which means you should disconnect the paths first
     }
}


Here is the code cleaned up. I would also set the doors as the target of the triggers and make some more tweaks, but this is cleaner and you can add as many triggers as you want this way: (sorry for any typos or errors, didn't test)
Code Snippet
Plaintext

function openDoor()
{
     trigs = GetEntArray("triggers","targetname");
     level.buttonsNeeded = trigs.size;

     door = GetEnt("door", "targetname");
     
     doorClip = GetEnt("door_clip", "targetname");//I personally would set the clip as the doors target and not use level var
     doorClip DisconnectPaths();

     foreach(trig in trigs)
     {
          trig thread Trig1(door, doorClip);
     }
}

function Trig1(door, doorClip)
{
     self SetCursorHint("HINT_NOICON");
     self SetHintString("Press [{+activate}] to...");

     self waittill("trigger", player);
     level.buttonsPressed--;
     self Delete();
     CheckDoor(door, doorClip);
}

function CheckDoor(door, doorClip)
{
     if(level.buttonsNeeded<=0)
     {
          doorClip ConnectPaths();
          door Delete();
          doorClip Delete();
     }
}


thank you!!!! :D

In radiant it is use_trigger?
7 years ago
Do you have models/textures associated with 2 and 3? :P
I have it.
Is your zombie random face?
7 years ago
Please tell me the script to open the door for free with 3 buttons. :)
7 years ago
Loading ...