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 - Chilltacular

I have a map in which the player teleports to a room that I put under the map, but in the game, the models pop in and out of view when the player moves around. Anyone know what could be causing this?
7 years ago
Code Snippet
Plaintext
function openDoor()
{
     level.door = GetEnt("door", "targetname");
     level.trig1 = GetEnt("trigger1", "targetname");
     level.trig2 = GetEnt("trigger2", "targetname");
     level.trig3 = GetEnt("trigger3", "targetname");
     level.doorClip = GetEnt("door_clip", "targetname");
     level.buttonsNeeded = 3;
     level.buttonsPressed = 0;
     thread Trig1();
     thread Trig2();
     thread Trig3();
}

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

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()
{
     if(level.buttonsPressed == level.buttonsNeeded)
     {
     level.door Delete();
     level.doorClip Delete();
     }
}


You would have to make sure that the door is either a script model or a script brushmodel and is named "door" for its target name and each of the triggers are named "trigger1", "trigger2", and "trigger3" in the targetname. If you want you could change the names but they have to correspond in radiant and the script. I included a clip in there in case you use a model for the door instead of a brushmodel as models are non collidable and can be walked through without a clip. Make sure the clip covers the entire door so players can't walk through it.

If you choose to you can rotate the door instead of deleting it by using RotateYaw([angle], [time for rotation]) instead of Delete(), but I won't get into that you can just look it up. JBird has some tutorials on doors and rotations on youtube.
7 years ago
Oh thanks. Where could I find the documentation for all that?

Double Post Merge: February 22, 2017, 05:30:05 am
The docs say:

Code Snippet
Plaintext

entity GetAISpeciesArray([team],[species])

[OPTIONAL] [team] a team name, either 'axis', 'allies', 'neutral', or 'all'. Defaults to 'all'.
[OPTIONAL] [species] species of AI to get, 'human', 'dog', 'robot' or 'all'. Defaults to 'human'.
CATEGORY:
CLIENT/SERVER: Server
SUMMARY: Returns an array of the AI
EXAMPLE: aiarray = GetAISpeciesArray( "axis", "all" )

So I would assume:
Code Snippet
Plaintext
dogs = GetAISpeciesArray( "axis", "dog" );

That didn't work either for some reason. I looked at the docs and I couldn't find anything else besides GetAiArray(name, key) which worked for zombies using GetAiArray("zombie", "targetname") But I couldn't find anyway to do that with dogs.
7 years ago
I know you can get an array of all the zombies through GetAiSpeciesArray("axis", "all")

I was wondering if anyone knew how how to get an array of just dogs?
7 years ago
I'm trying to check whether a variable is a multiple of 360.  I'm just printing to screen the following

level.mHand % 360

but I don't get anything showing up. If I change the operator to a multiplication sign and multiply by 2 for example, it works. If I change the variable to any other number instead of a variable, it works, but it seems that using modulus with a variable doesn't work for some reason and I was wondering if anyone had a solution. Any help is appreciated.
7 years ago
Loading ...