Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Making NF bubbles in JK.
Making NF bubbles in JK.
2003-08-18, 5:12 AM #1
Hi, Yeah I'm trying to find a verb to make a No Force Bubble in Jediknight, one that a Yslarmi would make when touched in MotS, or JK2, I tried running some verbs through with datamaster and the JK spec's, but nothing fits the job, can I get some help


[EDIT]I want to make this NF bubble work when you touch and hold an object.
------------------
Ping (peeng) n. The number of milliseconds it takes between the time my conc bullet has blown you to hell and the time you realize it.

[This message has been edited by Apocalypse (edited August 18, 2003).]
2003-08-18, 5:37 AM #2
Hi there [http://forums.massassi.net/html/smile.gif]

I could be mistaken, but I think that the NF bubble that you refer to also references template settings as to its spherical creation shape....

The actual code though ... well I'm kinda tired right now (just got back from an interview) but I'll certainly look into it for you after I've had 40 winks... [http://forums.massassi.net/html/wink.gif]

-Jackpot

PS: Also, what do you actually want to do with it? (Have it activate when a player touches an item or surface or enters a sector; kills a character, etc etc...?)

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-08-19, 5:48 AM #3
Hi there [http://forums.massassi.net/html/smile.gif]

Sorry about the delay - 40 winks turned out to be a complete "overnight nap" [http://forums.massassi.net/html/wink.gif]

Anyways ... Even with your edit, I'm not overly clear on what you're trying to do. That said however, I've devised a quick cog for you that hopefully meets your criteria.

What I was unclear about was whether or not you wanted this script to work as an item in part of your inventory, or just a temporary effect (I've assumed the latter). Also, on what conditions would you like the effect to stop? - I've set a timer to expire and for the bubble effect to stop if you take health damage, but please post back here with more specific requirements so I can sort the cog out completely (unless the script is exactly what you wanted) [http://forums.massassi.net/html/wink.gif] [http://forums.massassi.net/html/redface.gif]

Either way, feel free to post back here if you have any queries, and I'll do my best to answer them/fix any bugs [http://forums.massassi.net/html/smile.gif]

Code:

##
#
# 00_nfBubble.COG
#
# Creates a NF-Bubble like effect, when a specified item (thing)
# is touched.
# Lasts for as long as you set the "effectDuration" variable.
# If you take direct health damage (ie falling etc) then the effect will stop...
#
# Set verbose=1, if you want to see print out messages.
# (More for test purposes than anything else...)
#
# This COG script is NOT supported by LucasArts or LEC.
#
# Permission is granted to use this script by the author, as long as credit
# is provided in the readme file for any add-on levels that use this script.
#
#
# E-mail: lucky_jackpot@hotmail.com
# [RJS]
#
##

symbols

    message startup
    message touched
    message pulse
    message timer

    thing   player      local
    thing   bubbleCreatingItem        linkid=1    # item (thing) to create bubble
    thing   nf_bubble  local

    template nfBubble_tpl=+redsphere

    int     startHealth             local
    int     bubbleActivated=0   local
    int     isBubbleAlive=0       local
    flex    effectDuration=1.0              # Previously called "timerDelay"


    int     verbose=0

end


#==
#==
#==

code

startup:

    if (verbose)
    Sleep (0.5);
    Print ("Startup MSG !!!");

    player = GetSourceRef();
    startHealth = GetThingHealth (player);

    // CycleCamera();

    return;

#........

touched:

    if (GetSenderID() != 1)
        return;

    if (GetSenderID() == 1) {
        if (verbose)
        Print ("Touched NF Bubble ITEM thing...");

        bubbleActivated = 1;
        isBubbleAlive = 1;

        if (bubbleActivated) {
            if (isBubbleAlive) {
                SetPulse (0.1); // Set a pulse to see whether bubble is still alive...
                nf_bubble = CreateThing (nfBubble_tpl, player);
                AttachThingToThingEx (nf_bubble, player, 0x8);
            }
            SetTimerEx (effectDuration, 9999, 0, 0);     // Set a time for bubble to automatically run out
        }
        else    // Shouldn't reach here under the conditions, but just in case...
        if (bubbleActivated == 0) {
            if (verbose)
            Print ("NO BUBBLE");
            call burstBubble;
        }
    }

    return;

#........

pulse:

    if (verbose)
    Print ("PULSING !!!");

        // Set Conditions For Pulse Tests Here....

    if (GetThingHealth (player) < startHealth) {
        if (verbose)
        Print ("Player Hurt...");
        call burstBubble;
    }

    return;

#........

burstBubble:

    bubbleActivated = 0;
    isBubbleAlive = 0;
    SetPulse (0.0);     // Negate pulse effect...
    KillTimerEx (0.0);
    DetachThing (nf_bubble);    // Detach bubble object thing...
    DestroyThing (nf_bubble);   // ... and then remove it from game

    return;

#........

timer:

    if (verbose)
    Print ("Timer");

    if (isBubbleAlive == 0) {    // if the bubble is still alive after pulses...
        if (verbose)
        Print ("Bubble killed before timer expired...");
        return;
    }

    if (GetSenderID() == 9999) {
        if (verbose)
        Print ("Timer Elapsed - remove bubble");
        call burstBubble;
    }

    return;

#........


end


Hope this helps [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||

↑ Up to the top!