FunkySwerve wrote...
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
Hi again Funky.
Thanks a lot for your last reply. I found it very helpful indeed!
'>
The very quick demo mod you made, has also helped me a lot too. Thanks for that.
'>
It seems I didn't have much of an eagle eye to spot the small mistake you made in your earlier reply though.
I only noticed it after you pointed it out in your last post. I'm glad you were able to spot it and correct it for me.
Thanks!
'>
I added a little something extra to the airship script you made. (or should I say.... rising / floating rowboat script?
'>)
[quote]
#include "place_rise_inc"
#include "in_g_cutscene"
void main() {
// Find actors
object oPC = GetFirstPC();
GestaltStartCutscene(oPC,"mycutscene");
GestaltCameraCrane (1.0,
180.0, 15.0, 90.0, 0.0,
180.0, 15.0, 90.0, 50.0,
95.0, 40.0,
oPC, 0);
GestaltStopCutscene (50.0, oPC);
object oAirShip = GetObjectByTag("Airship1");
StartPlaceableAscent(oAirShip, 1.0, 27.0, 2.0);
}
[/quote]
You'll probably recognize where I got that other part from. I find it very handy indeed!
I wanted to make a script which causes the screen view to rise up, just as the placeable boat or airship e.t.c does so that you can rise up with the placeable as you're watching it.
There is only 1 more little script I would like to add, which I am not too sure how to get hold of right now.
A cutscene invisibility script, which I have tried out with Lilac Soul's Script Generator. But for the type of script it creates for this effect, I cannot seem to be able to fit it in to enable the whole script to complete a successful compile.
If this is a bit too much to ask, after the amount of help you have given me already, then no worries.
It seems just a small piece of script though really. If you are able to spare a little time to put one in for me, It would be very helpful indeed! I would much appreciate it.
'>
Thanks again for the extra help, the quick demo and correcting the script.
I've started making use of it already, and it's working just fine.
Regards,
''MissJaded''
FunkySwerve wrote...
A conditional script is the only
kind in nwn besides includes that doesn't have a void main () function.
Instead it returns TRUE or FALSE, and is used to determine whether or
not to display a line of conversation in a nwn dialogue. It has nothing
to do with this other than being the cause of your compiler error.
Other compilers, like the PRCs, are able to identify and ignore
includes.
Funky
Ahh yes. I think I see what a conditional script is..... not fully since it does sound a litlte confusing.
But it does sound like one is really only used from pc and/or npc conversations, which as you stated, has nothing to do with this airship scripting stuff.
Regards,
"MissJaded"B)
Modifié par MissJaded, 06 novembre 2010 - 04:28 .