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

Hello all. So I know how to script an script_model or script_brushmodel to move however I please, but I can not figure out how to get the PaP to move. I tried giving the prefab a targetname and then refer to that in the scripts using GetEnt. I have also attempted to use GetEnt by setting up a script_string KVP on the PaP prefab and then calling it out in scripts. Both methods did not work. It seems like the KVP's of targetname and script_string are not working to call out the PaP in my scripts with GetEnt. So, does anyone know how to move use GetEnt on the PaP prefab or simply how to move the PaP so it lowers down to a lower position? Thanks in advance!

function PaPelevator()
    upstairsTrigger = GetEnt("PaPelev_topLevel","targetname");
    upstairsLeftDoor = GetEnt("PaPdoor_topLeft","targetname");
    upstairsRightDoor = GetEnt("PaPdoor_topRight","targentame");

    upstairsTrigger SetHintString("Power must be turned on.");
    upstairsTrigger SetCursorHint( "HINT_NOICON" );

    level flag::wait_till( "power_on" );

    upstairsTrigger SetHintString("Requires activiation from the lower level panel.");

    elevatorPlatform = GetEnt("PaPelev_platform","targetname");
    PaP = GetEnt("PaP","targetname");
    Cargo1 = GetEnt("PaPelev_cargo1","targetname");
    Cargo2 = GetEnt("PaPelev_cargo2","targetname");
    Cargo3 = GetEnt("PaPelev_cargo3","targetname");
    Cargo4 = GetEnt("PaPelev_cargo4","targetname");

    elevatorPlatform MoveZ(-100, 5);
    PaP MoveZ(-100, 5);
    Cargo1 MoveZ(-100, 5);
    Cargo2 MoveZ(-100, 5);
    Cargo3 MoveZ(-100, 5);
    Cargo4 MoveZ(-100, 5);
This is what I have written. The cargo elements work perfectly. The PaP does not however.
108 days ago
Hey guys! Is there a line of code that makes it so the script waits until the next round starts before it runs the rest of the script?
515 days ago
Not sure if this will benefit anyone who may view this thread in the future, but if you are wondering how to do what I asked about as well, I did manage to write a chunk of code that basically checks to see if you are holding F every second the code runs. The "use button" is referencing whatever button you press to basically do anything (buy perks, buy weapons off the wall, etc.).

for(i = 5; i > 0; i--) //For i = 5 you can change the five to how ever many seconds you want the player to hold F for.
if(player UseButtonPressed()) //UseButtonPressed is referencing whatever button you have to press to buy doors, perks, and so on. For my controls that button is F.
player DisableWeapons();
wait 1;
player EnableWeapons();
NOTE: you may have to change lines of this code to adjust it to what you want the script to do and to make it work correctly with your script. If you have any questions about this chunk of code don't be afraid to ask! (:
515 days ago
Hey guys! So, I tried looking on this link for a built-in function but I could not find anything (link: What line of code would I write to have it so the player has to hold F for 5 seconds before it allows th rest of the script to run? I know how to do it for pressing F once, but I do not know how to write it so that you have to hold F for 5 seconds. Any help with this would be much appreciated!

On a second note, how do I go about making it so that while the player is holding F , a "progress bar" appears that fills up to show you how much longer you have to hold F for?

523 days ago
Hello! I was windering how do I go about playing a sound in my level so that way it plays lovally on an object. Example: as I walk up to a generator I can hear that the generator is running.
619 days ago
Hello all!

I was wondering how would i go about coding an object so that it can not be seen in level initially but spawn in later after an easter egg step. My main question is how do I make an object spawn in the level through code at an origon of my choice or at the location of a script struct.
634 days ago
I think there are problems moving structs because they don't have a body (Atleast I couldn't use them). However if you have an entity you are able to move it to a direction.

How to use MoveTo?
Wall = getEnt("walldoor", "targetname");
Wall MoveTo( Wall.origin + (200, 200, 0), speed);

This should be the same as in cod waw?
 Hello! Thank you for replying to my post! I don’t think my question was very clear. I was wondering if there was a way so that I could place a script struct in one location, and then place a second script struct in a different location, and then script it so that a different entity moves from the first script struct to the second one.
641 days ago
Question for you all, how would I go about scripting something so that I can make it move from one script_struct to the next? I know there moveTo functions and such and I tried making them work using a script struct, but I could not get it to work. Anyone that can help me with this?
641 days ago
That's true, but the point is that 'self' can be anything, it's simply the variable/entity that called that function
 Hey guys! Really appreciate you guys clarifying that for me. It makes a lot more sense now. If you don’t mine me bothering you with one more question, when is it best to use “level”, “player”, or just threading the next function without anything in front of “thread blah blah blah”?
658 days ago
Use this:
self disable_trigger();

wait 15; // counter

self enable_trigger();
 Thanks! I really appreciate you helping me out! Just curious, what does"self" exactly do in terms of scripting? I've seen it used before, but I don't fully understand how it works.
662 days ago
Hey guys! I'm sure this is a simple thing to script, but I am lost as how to do it. How would one script it so that when I press "F" on a trigger, it will temporarily be unavailable to use until the script for that trigger has run? Example:

I press "F" on a trigger and it turns on a trap. While the trap is running I want the trigger to be unavailable and to have it give no indications of being able to press "F" (it will no longer say press F for blah blah, instead it will saying nothing) until the trap has finished running. Once the trap has finished running I then want the trigger to be able to be used again and to say "Press F to use".

I know how to change the hint icon for the trigger, but what I am mostly wondering is how to make the trigger temporarily unavailable. Any help would be much appreciated!
662 days ago
Hey guys! I'm sure this is something simple, but how would I go about writing in my script so that step two of the EE cannot be accessed until step one is completed?
698 days ago
trig = getEnt("nothing","targetname");

        trig waittill("trigger", player);
        weapon = player getcurrentweapon();
        if(weapon == "bowie")
            // do stuff
This is how you can do it in Cod World at War
 I shall give this a shot and let you know if it worked for bo3 (:
707 days ago
I don't know how it works in bo3 but I know how to do it in waw.

In code you have to get the trigger, when the trigger fires you have to check which weapon that player is holding. If it is the weaponName bowie knife you can let him do the rest of the code.
 Okay, what you are saying makes sense however my knowledge on how to write code isn't the greatest. What would a line of code look like that would "check  which weapon the player is holding"?
708 days ago
Hey guys!

Question is as the title says it. I was wondering how to write a line of script that makes it so you have to use only the bowie knife in order to enable a trigger damage? I am wanting the player to have to cut a chord in the map, but I want it so that only the bowie knife can cut the chord. Any help would be much appreciated!
710 days ago


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
Loading ...