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

Hi, i'm trying to do an EE that's rewards Pack-a-punching the gun.
I just do not know how to PaP the gun.
Anyone can help me with the script ? :-\
7 years ago
Hi, i'm trying to do an EE that's rewards Pack-a-punching the gun.
Anyone can help me with the script ? :-\
7 years ago
I re-wrote the script to be much shorter, and more flexible. I'm not trying to step on your toes, or 1-up you or anything like that. Just figured this might help, especially if you are busy and I know you've mentioned updating the script anyways, so maybe this will save you the trouble. If you don't use it that's fine also, no offense taken. I'm not the best scripter, but pretty decent I believe, lol. Here it is.

Code Snippet
Plaintext
//Follow the same steps in the tutorial, 
//except name all the triggers shootable_trig,
//and don't add numbers to them.
//Then make each trigger target it's bottle by selecting the trigger first,
//then select the bottle, hit W in radiant to link them.
//Now you can place as many of these as you want, without having to change anything in script.
//Let's get them all as an array
//instead of writing a seperate function for each bottle, and with no 'while()' loops eating memory

function init()
{
trigs = GetEntArray("shootable_trig", "targetname");
level.shootablesNeeded = trigs.size;
level.shootablesCollected = 0;
   
foreach(trig in trigs)
        {
        trig SetHintString("");
        trig SetCursorHint("HINT_NOICON");
        trig.bottle = GetEnt(trig.target, "targetname");
        trig thread trig_wait();
        }
}

function trig_wait()
{
self waittill("trigger");
self.bottle Delete();
level.shootablesCollected++;
if(level.shootablesCollected >= level.shootablesNeeded)
{
level thread reward();
}
IPrintLnBold("Shootables collected = ["+level.shootablesCollected+"]");
}

function reward()
{
IPrintLnBold("Reward given");
//insert reward code here
}

Thanks, this will help me a lot !!
7 years ago
No problem   :)

leonardo745, looking back at your original code, I noticed you weren't getting the trigger using
Code Snippet
Plaintext
trig_1 getEnt("whatever", "targetname");
so the game never knew what trigger it was looking for

I was, I just forgot to put it here.
My problem is the time to say which weapon I wanted the game to check.
Now my code looks like this:

Code Snippet
Plaintext
    trig_1 = GetEnt("trig_shootable", "targetname");
    trig_1 SetHintString("");
    trig_1 SetCursorHint("HINT_NOICON");
    level.etapas = 0;
    correctweapon = GetWeapon("tesla_gun");

    while(1)
    {
    trig_1 waittill("trigger", player);
    usingweapon = player GetCurrentWeapon();
    if(level.powerstatus >= level.poweron)
    {
    if(usingweapon == correctweapon)
    {
                playfx(level._effect["powerup_grabbed"] ,GetEnt("trig_shootable","targetname").origin);

playfx(level._effect["elec_transformer_rod"] ,(-228, -1111, 116), (0,0,0));
  playfx(level._effect["elec_transformer_rod"] ,(-249, -1098, 116), (0,0,0));
  playfx(level._effect["elec_transformer_rod"] ,(-269, -1086, 116), (0,0,0));

  playfx(level._effect["elec_transformer_fx"] ,(-232, -1069, 83), (35, 58 ,0));
  //playfx(level._effect["elec_transformer_fx"] ,GetEnt("elec_transformer_1","targetname").angles);
 
  }
    }
    }
7 years ago
Well, I stumbled upon this topic while searching through the help section. Hope this helps

http://ugx-mods.com/forum/index.php/topic,13911.0.html

someone in the topic mentioned that it worked for them.

Thank you very much, it worked for me too !! ;)
7 years ago
you might need to use this
Code Snippet
Plaintext
weapon = getWeapon("tesla_gun");
  • are you getting errors while linking your scripts?
  • Have you done all the necessary steps to make those fx play?
I can't really test anything at the moment because my game won't open

When I use this:

Code Snippet
Plaintext
weapon = getWeapon("tesla_gun");

 I'm get errors while linking, but when I use the code that I sent, it links but does not work in the game, and when I use without checking the weapon, the effects appear without any problem.




7 years ago
Quote
You can check what gun they have using getCurrentWeapon() and if the current weapon is the tesla_gun, you can do whatever you want after that.
Like this ? (Did not work)

Code Snippet
Plaintext
while(1)
    {
    trig_1 waittill("trigger", player);
    current_weapon = player GetCurrentWeapon();
    if(current_weapon == "tesla_gun")
    {           
                playfx(level._effect["powerup_grabbed"] ,GetEnt("trig_shootable","targetname").origin);
playfx(level._effect["elec_transformer_rod"] ,GetEnt("transformer_rod_7","targetname").origin);
  playfx(level._effect["elec_transformer_rod"] ,GetEnt("transformer_rod_8","targetname").origin);
  playfx(level._effect["elec_transformer_rod"] ,GetEnt("transformer_rod_9","targetname").origin);
  playfx(level._effect["elec_transformer_fx"] ,GetEnt("elec_transformer_1","targetname").origin);
  }
    }
7 years ago
Can you tell me how to allow the trigger to activate only when the tesla_gun fires at the trigger ?
7 years ago
Loading ...