Author Topic: Still Having Problems Trying To Raise An Airship :(. Please Help??  (Read 559 times)

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0


               I'm sorry to keep posting about this, to those people who read this who have read my airship script posts before.
It just seems that I'm forever getting absolutely nowhere in trying to get this thing right! '<img'>:('<img'>

The last post I made a while back on this subject, was - Here!

A very helpful person gave me a script there, which I have found rather useful indeed!
But there is still a part of it which isn't working correctly for me!'<img'>:(

Here is the script again, but this time after I have modified it a bit.

void main()
{

// Place this script on the Airship's OnHeartbeat
//
// AIRSHIP FIRE VARIABLE - airshipstart
//
// At some point, when the airship is ready to begin moving upward,
// change the airshipstart variable from 0 to something else.
//
// example - SetLocalInt(GetModule(), "airshipstart", 100);
//
// Once it's anything but 0, the script below will begin to fire.
//

object oMod = GetModule();
int nNth = GetLocalInt(GetModule(), "airshipup");

// Checks to see if script should begin to fire & airship to rise upward
if (GetLocalInt(GetModule(), "airshipstart") == 6) return;

// HB counter to destroy & create airship
nNth++;

if (GetLocalInt(GetModule(), "airshipup") == 0)
{
DestroyObject(GetObjectByTag("Airship1"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.0;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship002", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 3)
{
DestroyObject(GetObjectByTag("Airship2"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.5;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship003", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 4)
{
DestroyObject(GetObjectByTag("Airship3"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.10;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship004", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 5)
{
DestroyObject(GetObjectByTag("Airship4"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.15;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship005", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 6)
{
DestroyObject(GetObjectByTag("Airship5"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.20;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship006", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 7)
{
DestroyObject(GetObjectByTag("Airship6"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.25;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship007", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 8)
{
DestroyObject(GetObjectByTag("Airship7"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.30;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship008", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 9)
{
DestroyObject(GetObjectByTag("Airship8"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.35;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship009", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 10)
{
DestroyObject(GetObjectByTag("Airship9"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.40;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship010", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 11)
{
DestroyObject(GetObjectByTag("Airship10"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.45;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship011", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 12)
{
DestroyObject(GetObjectByTag("Airship11"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.50;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship012", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 13)
{
// END AIRSHIP JOURNEY
DestroyObject(GetObjectByTag("Airship12"));
SetLocalInt(GetModule(), "airshipstart", 9000);
}

}


Also, for a completely different change, I made a very rough and completely simple clip to show what is happening with my airship, which may or may not be of any help, but anyway....... it's a very quick clip, so here we go!

Airship Rises (Click Here)

There are a still a couple of issues I have here, and I'm not completely sure how to correct them. ':crying:'
So I'm hoping someone might come along and help me out a bit please?

1) That is not the required height that I wish my airship to go up to!'<img'> I want it to go up, much, much, MUCH higher than that!

Does this require more of an extension to my airship script, as I have edited the original which was made for me, and played around with the numbers on there, changing them around, but yet I cannot get my airship to go up any higher than you have seen in my clip.'<img'>

What else could be added to get my desired script to work?
It's quite long as it is. An extension will obviously make it even looooonnnnggeeeeerrrrr!! *sigh!*


2) Why doesn't the last copy of the airship STAY.... destroyed as I have tried to show in the script??'<img'>
The airship is supposed to RISE UP..... then at a certain point, its is supppsoed to disappear, and you don't see the last one! That is what the "destroy airship" is SUPPOSED..... to do!! Or at least I THOUGHT it was!'<img'>

Is there a way to create this desired effect please, and with the one in my first 1 question too??
               
               

               


                     Modifié par MissJaded, 02 novembre 2010 - 01:24 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #1 on: November 02, 2010, 03:43:02 pm »


               It's not rising or deleting because the script only fires the first time - after that, it stops working.

The probable reason that it stops working is that heartbeats on spawned in placeables have VERY low engine priority - assuming you have the heartbeat in the palette versions at all (why it is you used 12 palette items for this, is beyond me). In a small test module, it probably should still work, but I can't tell that from what you posted. Other possibilities exist, but that's my best guess. In any event, I'll write you up a proper pseudoheartbeat to do this, since it's a much more elegant solution.

Funky
               
               

               


                     Modifié par FunkySwerve, 02 novembre 2010 - 03:44 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #2 on: November 02, 2010, 03:53:11 pm »


               First,

if (GetLocalInt(GetModule(), "airshipstart") == 6) return;

This means the airship will stop moving upward when the count is 6. You need to change this line to

if (GetLocalInt(GetModule(), "airshipstart") == 9000) return;

This is based on the value you've given it at the end of the script.

It's one reason the ship is not destroyed and why it stops moving upward.

Also, the height count is off.

You have the airship rise from 3.0 to 3.5 then back to 3.10, followed by 3.15, 3.20.

Personally, the numbers should be higher but it all depends on what effect you're going for - a slow climb or something more obvious.

EDIT: I'm sure Funky's script will be a lot more efficient and help you get to your end goal.

FP!
               
               

               


                     Modifié par Fester Pot, 02 novembre 2010 - 03:54 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #3 on: November 02, 2010, 04:36:22 pm »


               Ok, here's the code. Include first : save this script as place_rise_inc:


// This function will create the illusion of a placeable moving up to the sky. It
// will eventually destroy the placeable. fRate is the rate of Ascent, the amount
// of height to 'move' during each iteration of the function. fCeiling is the
// highest you want the placeable to go before deleting, and fInterval is the number
// of seconds between iterations of the function. I entered default values for them
// based on the script you had, but you can specify them as you like.
void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0);

void DoPlaceableAscent(float fRate, float fCeiling, float fInterval) {
    object oArea = OBJECT_SELF;//We AssignCommanded to the area, making it O.S.
    object oRise = GetLocalObject(oArea, "RisingPlaceable");
    location lLoc = GetLocation(oRise);
    vector vVec = GetPositionFromLocation(lLoc);
    vVec.z += fRate;

    if (vVec.z > fCeiling) {//end pseudo if the next move would take us over the ceiling
        DestroyObject(oRise);
        DeleteLocalObject(oArea, "RisingPlaceable");
        return;
    }

    //Since we didn't end the psuedo, we fire up the next iteration
    DelayCommand(fInterval, DoPlaceableAscent(fRate, fCeiling, fInterval));

    //The rest is simply creating the new, destroying the old
    string sRes = GetResRef(oRise);
    float fFace = GetFacingFromLocation(lLoc);
    location lNew = Location(oArea, vVec, fFace);
    DestroyObject(oRise);

    //normally I would delay creation by a second or so to make it look more natural, but
    //I'm trying to keep this simple
    object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, sRes, lNew);
    SetLocalObject(oArea, "RisingPlaceble", oNew);
}

void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0) {
    object oArea = GetArea(oPlaceable);
    SetLocalObject(oArea, "RisingPlaceable", oPlaceable);
    AssignCommand(oArea, DoPlaceableAscent(fRate, fCeiling, fInterval));
}

You can then include it in any other script. Here's a sample script using it:

#include "place_rise_inc"
void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip);
}
The way I wrote it, however, allows you to specify exactly how it rises. You can specify the distance it moves with each rise, how high it goes before deleting, and the amount of time between each rise. I suggest you don't go smaller than 2 or 3 seconds apart, but I leave that up to you. Here's a sample script that raises the ship by 1.0 every 3 seconds, and deletes the ship after it rises above 40.0:

#include "place_rise_inc"

void main() {

    object oAirShip = GetObjectByTag("Airship1");

    StartPlaceableAscent(oAirShip, 1.0, 40.0, 3.0);

}

LMK if you have further questions.

Funky
               
               

               
            

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #4 on: November 02, 2010, 07:03:54 pm »


               

FunkySwerve wrote...

It's not rising or deleting because the script only fires the first time - after that, it stops working.

The probable reason that it stops working is that heartbeats on spawned in placeables have VERY low engine priority - assuming you have the heartbeat in the palette versions at all (why it is you used 12 palette items for this, is beyond me). In a small test module, it probably should still work, but I can't tell that from what you posted. Other possibilities exist, but that's my best guess. In any event, I'll write you up a proper pseudoheartbeat to do this, since it's a much more elegant solution.

Funky


Hi there.

The reason I put in 12 palette versions of the airship was becasue it wasn't working with just 1.alone!'<img'>

The script contains "destroy object" and "create object"12 times.
So I had to create 12 airships so that the effect would work on 12 airships. Otherwise it would only create and destroy the same airship over and over and over...... and it wouldn't work or look right either!'<img'>

Regardless..... this thing STILL isn't working for me unfortunately!!'<img'>
               
               

               


                     Modifié par MissJaded, 02 novembre 2010 - 07:04 .
                     
                  


            

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #5 on: November 02, 2010, 07:18:30 pm »


               

Fester Pot wrote...

First,

if (GetLocalInt(GetModule(), "airshipstart") == 6) return;

This means the airship will stop moving upward when the count is 6. You need to change this line to

if (GetLocalInt(GetModule(), "airshipstart") == 9000) return;

This is based on the value you've given it at the end of the script.

It's one reason the ship is not destroyed and why it stops moving upward.

Also, the height count is off.

You have the airship rise from 3.0 to 3.5 then back to 3.10, followed by 3.15, 3.20.

Personally, the numbers should be higher but it all depends on what effect you're going for - a slow climb or something more obvious.

EDIT: I'm sure Funky's script will be a lot more efficient and help you get to your end goal.

FP!


Hi again.

Glad I got a reply from the person who originally helped me with this script in the first place.

I have re-edited the script again. I changed :
if (GetLocalInt(GetModule(), "airshipstart") == 6) return;

To

if (GetLocalInt(GetModule(), "airshipstart") == 9000) return;

for the start and end of the script.

I now assume that both numbers have to be the same, instead of the first one being a lower number as I had originally thought.

I originally started with 6, becaue I assumed that was supposed to be the starting height at which the airship would start out at. Just shows how much I know about scripting, doesn't it? *sigh!

I also changed the other numbers too.
What I had as 3.0 to 3.5 to 3.10 and 3.20, I now changed it to something like 3.0 to 4.0 to 5.0 and 6.0 e.t.c

Unfortunately this thing STILL ISN'T working for me at all!! I'm STILL getting the same result as I showed in my clip and it will not rise any further than that!!'<img'>:(

Do the numbers need to be even biggger for e.g. 10.0 to 20.0 to 30.0 and 40.0?
Would that work at all, or do they need to be even bigger than that?
Please can you tell me by how much I would need to change the numbers for the airship to go even higher than it shows in the clip I made?
               
               

               


                     Modifié par MissJaded, 02 novembre 2010 - 07:23 .
                     
                  


            

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #6 on: November 02, 2010, 07:31:45 pm »


               

FunkySwerve wrote...

Ok, here's the code. Include first : save this script as place_rise_inc:


// This function will create the illusion of a placeable moving up to the sky. It
// will eventually destroy the placeable. fRate is the rate of Ascent, the amount
// of height to 'move' during each iteration of the function. fCeiling is the
// highest you want the placeable to go before deleting, and fInterval is the number
// of seconds between iterations of the function. I entered default values for them
// based on the script you had, but you can specify them as you like.
void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0);

void DoPlaceableAscent(float fRate, float fCeiling, float fInterval) {
    object oArea = OBJECT_SELF;//We AssignCommanded to the area, making it O.S.
    object oRise = GetLocalObject(oArea, "RisingPlaceable");
    location lLoc = GetLocation(oRise);
    vector vVec = GetPositionFromLocation(lLoc);
    vVec.z += fRate;

    if (vVec.z > fCeiling) {//end pseudo if the next move would take us over the ceiling
        DestroyObject(oRise);
        DeleteLocalObject(oArea, "RisingPlaceable");
        return;
    }

    //Since we didn't end the psuedo, we fire up the next iteration
    DelayCommand(fInterval, DoPlaceableAscent(fRate, fCeiling, fInterval));

    //The rest is simply creating the new, destroying the old
    string sRes = GetResRef(oRise);
    float fFace = GetFacingFromLocation(lLoc);
    location lNew = Location(oArea, vVec, fFace);
    DestroyObject(oRise);

    //normally I would delay creation by a second or so to make it look more natural, but
    //I'm trying to keep this simple
    object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, sRes, lNew);
    SetLocalObject(oArea, "RisingPlaceble", oNew);
}

void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0) {
    object oArea = GetArea(oPlaceable);
    SetLocalObject(oArea, "RisingPlaceable", oPlaceable);
    AssignCommand(oArea, DoPlaceableAscent(fRate, fCeiling, fInterval));
}

You can then include it in any other script. Here's a sample script using it:

#include "place_rise_inc"
void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip);
}
The way I wrote it, however, allows you to specify exactly how it rises. You can specify the distance it moves with each rise, how high it goes before deleting, and the amount of time between each rise. I suggest you don't go smaller than 2 or 3 seconds apart, but I leave that up to you. Here's a sample script that raises the ship by 1.0 every 3 seconds, and deletes the ship after it rises above 40.0:

#include "place_rise_inc"

void main() {

    object oAirShip = GetObjectByTag("Airship1");

    StartPlaceableAscent(oAirShip, 1.0, 40.0, 3.0);

}

LMK if you have further questions.

Funky


Hi there.

Thank you for your helpful reply.

Unfortunately..... NONE of your code/script is working for me at all!'<img'>:(

I saved the 1st one you wrote as place_rise_inc:
I even tried placing #include "place_rise_inc" right at the top/start before void

All I am getting back from your scripts are a ton of complie errors, and NONE OF THIS is owrking for me whatsover!!'<img'>:(Hence..... NONE OF IT will compile successfully!!'<img'>:(

I know there is probabaly something I am doing wrong! But I just cannot work out what it is!!'<img'>:(



Edit : 

Screenshot - http://img101.images...shipcodejpg.jpg

Okay.... this is one of those conditional code script things I guess.
I have never understood how they work!'<img'>

I don't know whether to click YES or NO on that!
Regardless..... whatever I choose, it's not going to compile sucessfully
So how exactly do these type of scripts work?? If it doesn't compile.... then it's not going to work.... right??

*Sigh!* These types of scripts are always so confuisng to me! I'm noty sure if I can ever understand them properly!!'<img'>
               
               

               


                     Modifié par MissJaded, 02 novembre 2010 - 07:53 .
                     
                  


            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #7 on: November 02, 2010, 08:08:46 pm »


               

MissJaded wrote...


Hi again.

Glad I got a reply from the person who originally helped me with this script in the first place.

I have re-edited the script again. I changed :
if (GetLocalInt(GetModule(), "airshipstart") == 6) return;

To

if (GetLocalInt(GetModule(), "airshipstart") == 9000) return;

for the start and end of the script.

I now assume that both numbers have to be the same, instead of the first one being a lower number as I had originally thought.

I originally started with 6, becaue I assumed that was supposed to be the starting height at which the airship would start out at. Just shows how much I know about scripting, doesn't it? *sigh!

I also changed the other numbers too.
What I had as 3.0 to 3.5 to 3.10 and 3.20, I now changed it to something like 3.0 to 4.0 to 5.0 and 6.0 e.t.c

Unfortunately this thing STILL ISN'T working for me at all!! I'm STILL getting the same result as I showed in my clip and it will not rise any further than that!!'<img'>:(

Do the numbers need to be even biggger for e.g. 10.0 to 20.0 to 30.0 and 40.0?
Would that work at all, or do they need to be even bigger than that?
Please can you tell me by how much I would need to change the numbers for the airship to go even higher than it shows in the clip I made?


Well, for whatever reason you're creating 12 different placeable objects of the airship. You really only need one.

Second, if it's stopping it could be because the new placeable airship object it's creating does not have the script attached to it.

I've tested what I'm pasting below with a BOULDER placeable.

TAG - AIRSHIP
RES - airship

It worked fine and went upward as expected.

void main()
{

// Place this script on the Airship's OnHeartbeat
//
// AIRSHIP FIRE VARIABLE - airshipstart
//
// At some point, when the airship is ready to begin moving upward,
// change the airshipstart variable from 0 to something else.
//
// example - SetLocalInt(GetModule(), "airshipstart", 100);
//
// Once it's anything but 0, the script below will begin to fire.
//

object oMod = GetModule();
int nNth = GetLocalInt(GetModule(), "airshipup");

// Checks to see if script should begin to fire & airship to rise upward
if (GetLocalInt(GetModule(), "airshipstart") == 9000) return;

// HB counter to destroy & create airship
nNth++;
SetLocalInt(GetModule(), "airshipup", nNth);

if (GetLocalInt(GetModule(), "airshipup") == 1)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 1.0;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);
}

if (GetLocalInt(GetModule(), "airshipup") == 2)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 1.5;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 3)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 2.0;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 4)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 2.5;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 5)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.0;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 6)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 3.5;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);
}
if (GetLocalInt(GetModule(), "airshipup") == 7)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 4.0;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 8)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 4.5;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 9)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 5.0;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 10)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 5.5;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 11)
{
DestroyObject(GetObjectByTag("AIRSHIP"));
location lLoc1 = GetLocation(OBJECT_SELF);
float fFacing = GetFacing(OBJECT_SELF);
vector vPos1 = GetPositionFromLocation(lLoc1);
vPos1.z += 6.0;
lLoc1 = Location(GetArea(OBJECT_SELF), vPos1, fFacing);
CreateObject(OBJECT_TYPE_PLACEABLE, "airship", lLoc1);

}
if (GetLocalInt(GetModule(), "airshipup") == 12)
{
// END AIRSHIP JOURNEY
DestroyObject(GetObjectByTag("AIRSHIP"));
SetLocalInt(GetModule(), "airshipstart", 9000);
}

}


FP!
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #8 on: November 02, 2010, 08:09:52 pm »


               My code compiles fine. Something you did wrong is the cause of your problems. I get the sense from your replies that you have a lot of confusion about scripting in general, so I'll go over this step-by-step. If you still don't understand, I can whip up a quick demo module.

First, this is the include. An include doesn't do anything, it's just a reference script for other scripts. It has no void main, and you can't compile it. It is compiled when you compile another script that references it. If you try to compile it, the bioware toolset will think it's a conditional and ask if you want to compile it as one. It isn't, and you shouldn't. Think of it as storage for custom functions. I'm going to leave a large space at the beginning and end of it, to make sure you don't accidentally include anything in it you shouldn't - the lack of code boxes in this forum is rephrehensible:




// This function will create the illusion of a placeable moving up to the sky. It
// will eventually destroy the placeable. fRate is the rate of Ascent, the amount
// of height to 'move' during each iteration of the function. fCeiling is the
// highest you want the placeable to go before deleting, and fInterval is the number
// of seconds between iterations of the function. I entered default values for them
// based on the script you had, but you can specify them as you like.
void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0);

void DoPlaceableAscent(float fRate, float fCeiling, float fInterval) {
    object oArea = OBJECT_SELF;//We AssignCommanded to the area, making it O.S.
    object oRise = GetLocalObject(oArea, "RisingPlaceable");
    location lLoc = GetLocation(oRise);
    vector vVec = GetPositionFromLocation(lLoc);
    vVec.z += fRate;

    if (vVec.z > fCeiling) {//end pseudo if the next move would take us over the ceiling
        DestroyObject(oRise);
        DeleteLocalObject(oArea, "RisingPlaceable");
        return;
    }

    //Since we didn't end the psuedo, we fire up the next iteration
    DelayCommand(fInterval, DoPlaceableAscent(fRate, fCeiling, fInterval));

    //The rest is simply creating the new, destroying the old
    string sRes = GetResRef(oRise);
    float fFace = GetFacingFromLocation(lLoc);
    location lNew = Location(oArea, vVec, fFace);
    DestroyObject(oRise);

    //normally I would delay creation by a second or so to make it look more natural, but
    //I'm trying to keep this simple
    object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, sRes, lNew);
    SetLocalObject(oArea, "RisingPlaceble", oNew);
}

void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0) {
    object oArea = GetArea(oPlaceable);
    SetLocalObject(oArea, "RisingPlaceable", oPlaceable);
    AssignCommand(oArea, DoPlaceableAscent(fRate, fCeiling, fInterval));
}






That's it for the include. Save it place_rise_inc. I see you did that last time, but I want to ensure you have all of the include text, and nothing else.

Now, here is a script that uses that include. It could go in any event you choose. It gets the airship by tag, and issues the rise order. It will work on any placeable you target so long as it isn't static and it matches its palette version (which also cannot be static). You should make sure your airship's tag is correct (only the instance in the area, not the palette, matters for that), make sure both instance and palette version are nonstatic, and it will work.





[code]
[/code][code]#include "place_rise_inc"
void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip);
}[/code]




THIS script, the one that includes the include file, is the one you need to compile.

Now, here is another example, one in which different parameters are specified, instead of the defaults I built into the function:




[code]#include "place_rise_inc"

void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip, 1.0, 40.0, 3.0);
}[/code]





Again, you would only compile this script, if you wanted to use it. Does that make things any clearer?


Funky
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #9 on: November 02, 2010, 09:02:52 pm »


               I know these guys have already posted a lot of great working scripts. But I just figured I'd "throw my hat in the ring" too. You can try something like this and see if it helps or is easier to follow.

First set a path of waypoints that your airship will follow (be created at). Give them each a unique tag. Something like "AIRSHIP_WP1", "AIRSHIP_WP2" , etc... This makes it easy for turning the ship while on it's course or what not. Wherever the waypoint is pointing is generally the direction your ship will point(Not is all cases. If not then a correction in the faceing direction would have to be made).

This script is just sort of an example. I tested it out in a placeable control panel's "OnUsed" event. I also tested it out using a standard archery target:lol::


//Move a placealbe object along a path of waypoints (create and destroy)
#include "nw_i0_2q4luskan"

//Enter the tag of the object:
const string S_TAG = "ArcheryTarget";
//Enter the resref of the object:
const string S_RES = "plc_archtarget";

////////////////////////////////////////////////////////////////////////////////
object ObjectToDestroy()
{
object oObject = GetNearestObjectByTag(S_TAG);
return oObject;
}
////////////////////////////////////////////////////////////////////////////////
void DelayDestroy()
{
DestroyObject(ObjectToDestroy());
}
////////////////////////////////////////////////////////////////////////////////
void main()
{
int iType = OBJECT_TYPE_PLACEABLE;

DelayCommand(1.0, DelayDestroy());
DelayCommand(1.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP1"))));

DelayCommand(2.0, DelayDestroy());
DelayCommand(2.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP2"))));

DelayCommand(3.0, DelayDestroy());
DelayCommand(3.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP3"))));

DelayCommand(4.0, DelayDestroy());
DelayCommand(4.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP4"))));

DelayCommand(5.0, DelayDestroy());
DelayCommand(5.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP5"))));

//object vanishes into the distance....
DelayCommand(6.0, DelayDestroy());

}


Now just make sure you plug in the correct tag and res ref of the object that you will be raising and the correct tags of the waypoints you will use.
You may need to mess around with the delays too. Up to you.
And of course, following the same pattern in the script you can also keep going with plenty more waypoints.

Good luck.
               
               

               


                     Modifié par GhostOfGod, 02 novembre 2010 - 09:06 .
                     
                  


            

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #10 on: November 04, 2010, 06:18:43 am »


               

FunkySwerve wrote...

My code compiles fine. Something you did wrong is the cause of your problems. I get the sense from your replies that you have a lot of confusion about scripting in general, so I'll go over this step-by-step. If you still don't understand, I can whip up a quick demo module.

First, this is the include. An include doesn't do anything, it's just a reference script for other scripts. It has no void main, and you can't compile it. It is compiled when you compile another script that references it. If you try to compile it, the bioware toolset will think it's a conditional and ask if you want to compile it as one. It isn't, and you shouldn't. Think of it as storage for custom functions. I'm going to leave a large space at the beginning and end of it, to make sure you don't accidentally include anything in it you shouldn't - the lack of code boxes in this forum is rephrehensible:




// This function will create the illusion of a placeable moving up to the sky. It
// will eventually destroy the placeable. fRate is the rate of Ascent, the amount
// of height to 'move' during each iteration of the function. fCeiling is the
// highest you want the placeable to go before deleting, and fInterval is the number
// of seconds between iterations of the function. I entered default values for them
// based on the script you had, but you can specify them as you like.
void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0);

void DoPlaceableAscent(float fRate, float fCeiling, float fInterval) {
    object oArea = OBJECT_SELF;//We AssignCommanded to the area, making it O.S.
    object oRise = GetLocalObject(oArea, "RisingPlaceable");
    location lLoc = GetLocation(oRise);
    vector vVec = GetPositionFromLocation(lLoc);
    vVec.z += fRate;

    if (vVec.z > fCeiling) {//end pseudo if the next move would take us over the ceiling
        DestroyObject(oRise);
        DeleteLocalObject(oArea, "RisingPlaceable");
        return;
    }

    //Since we didn't end the psuedo, we fire up the next iteration
    DelayCommand(fInterval, DoPlaceableAscent(fRate, fCeiling, fInterval));

    //The rest is simply creating the new, destroying the old
    string sRes = GetResRef(oRise);
    float fFace = GetFacingFromLocation(lLoc);
    location lNew = Location(oArea, vVec, fFace);
    DestroyObject(oRise);

    //normally I would delay creation by a second or so to make it look more natural, but
    //I'm trying to keep this simple
    object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, sRes, lNew);
    SetLocalObject(oArea, "RisingPlaceble", oNew);
}

void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0) {
    object oArea = GetArea(oPlaceable);
    SetLocalObject(oArea, "RisingPlaceable", oPlaceable);
    AssignCommand(oArea, DoPlaceableAscent(fRate, fCeiling, fInterval));
}






That's it for the include. Save it place_rise_inc. I see you did that last time, but I want to ensure you have all of the include text, and nothing else.

Now, here is a script that uses that include. It could go in any event you choose. It gets the airship by tag, and issues the rise order. It will work on any placeable you target so long as it isn't static and it matches its palette version (which also cannot be static). You should make sure your airship's tag is correct (only the instance in the area, not the palette, matters for that), make sure both instance and palette version are nonstatic, and it will work.





[code]
[/code][code]#include "place_rise_inc"
void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip);
} /code]
[/code]




THIS script, the one that includes the include file, is the one you need to compile.

Now, here is another example, one in which different parameters are specified, instead of the defaults I built into the function:



[code]
[code]#include "place_rise_inc"

void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip, 1.0, 40.0, 3.0);
} /code]





Again, you would only compile this script, if you wanted to use it. Does that make things any clearer?


Funky


Hi again

Thanks a lot for going over and explaining how your code works.
You have helped me to understand it  a lot better now indeed! '<img'>

The first code you made was just an include, (as you already said) so I put it in my scrip editor and saved it as
place_rise_inc as said before, and when it asked if I wanted to save it as a conditional, I chose "No" since you said it wasn't.

I'm not too sure what a conditional script is to be honest. Is there any point to telling me what it is, or would it only confuse me further?

Anyway...... I borrowed the other very short scripts you made.
These 2 :

#include "place_rise_inc"
void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip);
}



#include "place_rise_inc"

void main() {
    object oAirShip = GetObjectByTag("Airship1");
    StartPlaceableAscent(oAirShip, 1.0, 40.0, 3.0);
}


I used them to test them out, and those are the ones which compile because they are referenced from the include you posted. So yeah..... I know how that works now, with your help.
Thanks. It was very helpful indeed!'<img'>

Okay.... now I'm still having an issue trying to get the airship to rise up to a high point, and it only stops quite low to the ground.... as usual. All the scripts from you and Fester Pot keep causing this to happen, and I don't understand why my airship won't rise a lot higher than I would like. It rises up, but It still stops at a low point, and I'm still not seeing the destroy effect at the last stop either.'<img'> (it might be in the first line somewhere, though I'm not completely sure)

I also changed to use just 1 airship placeable too, but I'm still getting this same problem. *sigh!*

In your script, where you have : StartPlaceableAscent(oAirShip, 1.0, 40.0, 3.0);
Wouldn't those numbers have to be bigger perhaps? When you jumped to 40.0, I don't understand  why you then went back down 3.0 again. If the middle number was 40.0, wouldn't the next one have to be (for e.g.) 50.0?
If you have a bit of time, please could you explain this?

Does the NwN 1 game engine have the capability for scripts to give the illusion of a placeable to rise very high up, or not? I just don't understand why this is isn't going right for me! *sigh!*

Anyhow..... I appreciate all the help that you and Fester Pot have given me with the scrpts you have both written out.
It has definitely worked to some extent at least, and I cannot stress enough how greatful I am for it.'<img'>

Thanks again.
"MissJaded"B)
               
               

               


                     Modifié par MissJaded, 04 novembre 2010 - 06:29 .
                     
                  


            

Legacy_MissJaded

  • Full Member
  • ***
  • Posts: 243
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #11 on: November 04, 2010, 06:45:27 am »


               

GhostOfGod wrote...

I know these guys have already posted a lot of great working scripts. But I just figured I'd "throw my hat in the ring" too. You can try something like this and see if it helps or is easier to follow.

First set a path of waypoints that your airship will follow (be created at). Give them each a unique tag. Something like "AIRSHIP_WP1", "AIRSHIP_WP2" , etc... This makes it easy for turning the ship while on it's course or what not. Wherever the waypoint is pointing is generally the direction your ship will point(Not is all cases. If not then a correction in the faceing direction would have to be made).

This script is just sort of an example. I tested it out in a placeable control panel's "OnUsed" event. I also tested it out using a standard archery target:lol::


//Move a placealbe object along a path of waypoints (create and destroy)
#include "nw_i0_2q4luskan"

//Enter the tag of the object:
const string S_TAG = "ArcheryTarget";
//Enter the resref of the object:
const string S_RES = "plc_archtarget";

////////////////////////////////////////////////////////////////////////////////
object ObjectToDestroy()
{
object oObject = GetNearestObjectByTag(S_TAG);
return oObject;
}
////////////////////////////////////////////////////////////////////////////////
void DelayDestroy()
{
DestroyObject(ObjectToDestroy());
}
////////////////////////////////////////////////////////////////////////////////
void main()
{
int iType = OBJECT_TYPE_PLACEABLE;

DelayCommand(1.0, DelayDestroy());
DelayCommand(1.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP1"))));

DelayCommand(2.0, DelayDestroy());
DelayCommand(2.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP2"))));

DelayCommand(3.0, DelayDestroy());
DelayCommand(3.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP3"))));

DelayCommand(4.0, DelayDestroy());
DelayCommand(4.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP4"))));

DelayCommand(5.0, DelayDestroy());
DelayCommand(5.1, CreateObjectVoid(iType, S_RES, GetLocation(GetWaypointByTag("ASHIP_WP5"))));

//object vanishes into the distance....
DelayCommand(6.0, DelayDestroy());

}


Now just make sure you plug in the correct tag and res ref of the object that you will be raising and the correct tags of the waypoints you will use.
You may need to mess around with the delays too. Up to you.
And of course, following the same pattern in the script you can also keep going with plenty more waypoints.

Good luck.



I'm now getting an image of a floating archery target, and it quite amuses me. Heheh '<img'>

I tried out your example too, but with a placeable flag/banner. (wanted to find somethng a bit bigger that was a bit more obviouse to watch) I put it in OnEnter of my area though, and it didn't quite work.
Think it maybe better if I place it in the placeable's OnUsed event instead.'<img'>
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #12 on: November 04, 2010, 06:53:02 am »


               I made it for a placeable's OnUsed event. If you want to use it in the OnEnter of an area then you would have to change the function "GetNearestObjectByTag" to "GetObjectByTag". Or you could leave it as is and try it in a trigger's "OnEnter" event near the object.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #13 on: November 04, 2010, 07:20:26 am »


               Deleted to avoid confusion.
               
               

               


                     Modifié par FunkySwerve, 04 novembre 2010 - 07:50 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Still Having Problems Trying To Raise An Airship :(. Please Help??
« Reply #14 on: November 04, 2010, 07:50:02 am »


               Scratch that. There was a one-character typo in one of the variable names, causing it to never lock on to the object after the first iteration, because it was looking for "RisingPlaceble" instead of "RisingPlaceable". Fixed. Here's the demo mod:

http://dl.dropbox.co...407/airship.mod


I used a rowboat dubbed Ye Old Flying Dutchman, because I was too lazy to download the CEP demo mod. I also adjusted it to move every 2 seconds in the demo, and set the ceiling to 27.0  (it goes out of sight at 26.0). Looks pretty cool.

So yes, all my fault. Mea culpa.

Here is the corrected include, should you not want to pull it from the demo module:






// This function will create the illusion of a placeable moving up to the sky. It
// will eventually destroy the placeable. fRate is the rate of Ascent, the amount
// of height to 'move' during each iteration of the function. fCeiling is the
// highest you want the placeable to go before deleting, and fInterval is the number
// of seconds between iterations of the function. I entered default values for them
// based on the script you had, but you can specify them as you like.
void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0);

void DoPlaceableAscent(float fRate, float fCeiling, float fInterval) {

    object oArea = OBJECT_SELF;//We AssignCommanded to the area, making it O.S.
    object oRise = GetLocalObject(oArea, "RisingPlaceable");

    location lLoc = GetLocation(oRise);
    vector vVec = GetPositionFromLocation(lLoc);
    vVec.z += fRate;

    if (vVec.z > fCeiling) {//end pseudo if the next move would take us over the ceiling
        DestroyObject(oRise);
        DeleteLocalObject(oArea, "RisingPlaceable");
        return;
    }

    //Since we didn't end the psuedo, we fire up the next iteration
    DelayCommand(fInterval, DoPlaceableAscent(fRate, fCeiling, fInterval));

    //The rest is simply creating the new, destroying the old
    string sRes = GetResRef(oRise);
    float fFace = GetFacingFromLocation(lLoc);
    location lNew = Location(oArea, vVec, fFace);
    DestroyObject(oRise);

    //normally I would delay creation by a second or so to make it look more natural, but
    //I'm trying to keep this simple
    object oNew = CreateObject(OBJECT_TYPE_PLACEABLE, sRes, lNew);
    SetLocalObject(oArea, "RisingPlaceable", oNew);
}

void StartPlaceableAscent(object oPlaceable, float fRate = 3.0, float fCeiling = 40.0, float fInterval = 6.0) {
    object oArea = GetArea(oPlaceable);
    SetLocalObject(oArea, "RisingPlaceable", oPlaceable);
    AssignCommand(oArea, DoPlaceableAscent(fRate, fCeiling, fInterval));
}





I was tempted to add more parameters, like change in rate of movement, movement on other axis, and such, but I'm gonna let you figure out the three you already have to toy with first. And yes, it will work from any event. I designed it to require a minimum of inputs and as much flexibility as possible with the simplistic inputs.

Best,
Funky
               
               

               


                     Modifié par FunkySwerve, 04 novembre 2010 - 07:56 .