UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: FLUXtrance on July 06, 2013, 04:38:41 pm

Title: Easter Egg Help!
Post by: FLUXtrance on July 06, 2013, 04:38:41 pm
First off, I will try to be as specific as possible. The Easter Egg I want to achieve is fairly simple, but seeing as I know very little of scripting much outside of the basics, I'll need some help. I'll give whoever is willing to help me full credit for their work. Thanks!

I would like to make a simple 5-piece Easter Egg. I have created a "tiki charm" prefab out of small brushes, and custom textures to be my "targets", and they are scattered throughout my map. I have also created a "tiki charm temple" (If you haven't guessed already my map is tropical themed). In the temple are important things such as the final teleporter to my map, a buyable ending, and PAP. I already have a text string display at the beginning of the map briefing the player on what he/she needs to do, here's where I need someones help:

How would I go about:

 -Creating a text string pop up when near a trigger on the charm saying "Hold (x) to Activate Tiki Charm"
 -Once all charms are active, open a door

EXTRA:

 -once all charms are active, create the hissing sound and screen shaking just like when activating the 3rd telporter on a Der Riese - Style map (I already have teleportes, the script is all there, would it be as simple as a copy/paste?)
 -A small counter on the HUD created when 1 of 5 tiki charms have been activated, and destroyed once all 5 have been activated

Thank you in advanced for reading if you got this far, I appreciate it. Like I said, any help would be much appreciated, and the two extras were merely out of curiosity of their difficulty to implement. If anyone thinks they can help me with this, I'd love to credit you for your work. Thank You! :D
Title: Re: Easter Egg Help!
Post by: YaPh1l on July 07, 2013, 11:47:28 am
-Creating a text string pop up when near a trigger on the charm saying "Hold (x) to Activate Tiki Charm"
Sounds like you just want a normal trigger_use.
-Once all charms are active, open a door
You'll need a custom script for that obviously. The other two things would be additions to that script basically.
Here's a basic script that I threw together from scratch, no guarantees, I'm not on my dev machine and can't test:
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

init()
{
    trigs = GetEntArray("tiki_charm", "targetname");
    array_thread(trigs, ::tiki_trigger_think);
    level thread tiki_watcher(trigs.size);
}

tiki_trigger_think()
{
    self waittill("trigger");
    level notify("tiki_charm_hit");
    self Delete();
}

tiki_watcher(num)
{
    for(i = 0; i < num; i++)
        level waittill("tiki_charm_hit");
    door = GetEnt("tiki_door", "targetname");
    door NotSolid();
    door ConnectPaths();
    door MoveZ(-200, 2);
    door waittill("movedone");
    door Delete();
}
trigger_use of tiki charms: targetname = tiki_charm
Door: targetname = tiki_door

- Phil.
Title: Re: Easter Egg Help!
Post by: FLUXtrance on July 07, 2013, 07:10:54 pm
Sounds like you just want a normal trigger_use.You'll need a custom script for that obviously. The other two things would be additions to that script basically.
Here's a basic script that I threw together from scratch, no guarantees, I'm not on my dev machine and can't test:
Code Snippet
Plaintext
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;

init()
{
    trigs = GetEntArray("tiki_charm", "targetname");
    array_thread(trigs, ::tiki_trigger_think);
    level thread tiki_watcher(trigs.size);
}

tiki_trigger_think()
{
    self waittill("trigger");
    level notify("tiki_charm_hit");
    self Delete();
}

tiki_watcher(num)
{
    for(i = 0; i < num; i++)
        level waittill("tiki_charm_hit");
    door = GetEnt("tiki_door", "targetname");
    door NotSolid();
    door ConnectPaths();
    door MoveZ(-200, 2);
    door waittill("movedone");
    door Delete();
}
trigger_use of tiki charms: targetname = tiki_charm
Door: targetname = tiki_door

- Phil.

I appreciate the reply phil! Fortunately, with the help of another scripter, I got a working script now. It's actually fairly similar to yours, and basically works the same way. Thanks for your help though!