Can someone with access to the code confirm what the world script events for beginning and cancelling a witchspace jump should be?
In the wiki they're listed as this.playerStartedJumpCountdown = function(type) and this.playerCancelledJumpCountdown = function() respectively, but neither of those work.
I've also looked in Ahruman's old Javascript example OXP which has this.didBeginJumpCountDown = function(type) and this.didCancelJumpCountDown but they don't work either.
Can anyone shed light on what does work for 1.72.1, and also for 1.72 and 1.71.2 if possible? I want the events for the start of and for the cancellation of a jump (standard or galactic), not when one is completed (the start of the countdown, not the end of it).
WorldScript Jump Countdown Events
Moderators: winston, another_commander, Getafix
WorldScript Jump Countdown Events
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Its a large Function, since this is the flight control function, however
it does seem to send of the script events that should trigger those respective events...
Here is the code snippet...
I´ll make a quick script, to confirm your results, if not, there is something else wrong...
it does seem to send of the script events that should trigger those respective events...
Here is the code snippet...
Code: Select all
if (status == STATUS_WITCHSPACE_COUNTDOWN)
{
// abort!
jumpOK = NO;
galactic_witchjump = NO;
status = STATUS_IN_FLIGHT;
[self playHyperspaceAborted];
// say it!
[UNIVERSE clearPreviousMessage];
[UNIVERSE addMessage:DESC(@"witch-user-abort") forCount:3.0];
[self doScriptEvent:@"playerCancelledJumpCountdown"];
}
if (jumpOK)
{
galactic_witchjump = NO;
witchspaceCountdown = 15.0;
status = STATUS_WITCHSPACE_COUNTDOWN;
[self playStandardHyperspace];
// say it!
[UNIVERSE clearPreviousMessage];
[UNIVERSE addMessage:[NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[witch-to-@-in-f-seconds]"), [UNIVERSE getSystemName:target_system_seed], witchspaceCountdown] forCount:1.0];
[self doScriptEvent:@"didBeginJumpCountDown" withArgument:@"standard"];
}
}
hyperspace_pressed = YES;
}
else
hyperspace_pressed = NO;
// Galactic hyperspace 'g'
if (([gameView isDown:key_galactic_hyperspace] || joyButtonState[BUTTON_GALACTICDRIVE]) &&
([self hasEquipmentItem:@"EQ_GAL_DRIVE"]))// look for the 'g' key
{
if (!galhyperspace_pressed)
{
BOOL jumpOK = YES;
if (status == STATUS_WITCHSPACE_COUNTDOWN)
{
// abort!
jumpOK = NO;
galactic_witchjump = NO;
status = STATUS_IN_FLIGHT;
[self playHyperspaceAborted];
// say it!
[UNIVERSE clearPreviousMessage];
[UNIVERSE addMessage:ExpandDescriptionForCurrentSystem(@"[witch-user-abort]") forCount:3.0];
[self doScriptEvent:@"playerCancelledJumpCountdown"];
}
if (jumpOK)
{
galactic_witchjump = YES;
witchspaceCountdown = 15.0;
status = STATUS_WITCHSPACE_COUNTDOWN;
[self playGalacticHyperspace];
// say it!
[UNIVERSE addMessage:[NSString stringWithFormat:ExpandDescriptionForCurrentSystem(@"[witch-galactic-in-f-seconds]"), witchspaceCountdown] forCount:1.0];
[self doScriptEvent:@"playerStartedJumpCountdown" withArgument:@"galactic"];
}
}
galhyperspace_pressed = YES;
}
Bounty Scanner
Number 935
Number 935
This is how I'm trying to use them in my code (a Javascript script.js):
Quite simple as you can see, but if I start a jump I don't get the consoleMessage for example. It's for the little intra-system taxi script I was mentioning for PlanetFall.
Code: Select all
this.playerStartedJumpCountDown = function(type)
{
player.consoleMessage("Hey, why are we going to witchspace?", 6);
missionVariables.planetFallTaxiOffer = "Worried";
}
this.playerCancelledJumpCountDown = function()
{
if(missionVariables.planetFallTaxiOffer == "Worried")
{
player.consoleMessage("Thanks, I only wanted to go locally!", 6);
missionVariables.planetFallTaxiOffer = "Hired";
}
}
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
It seems
Only works for galactic hyperspace
while
only this.playerCancelledJumpCountdown =function()
works for both normal witchspace jump and galactic hyperspace
so this.didBeginJumpCountDown is broken
Code: Select all
this.playerStartedJumpCountdown = function()
{
log("this.playerStartedJumpCountdown triggerd")
}
while
Code: Select all
this.didBeginJumpCountDown = function()
{
log("this.didBeginJumpCountDown triggerd")
}
this.playerCancelledJumpCountdown =function()
{
log("this.playerCancelledJumpCountdown triggerd")
}
works for both normal witchspace jump and galactic hyperspace
so this.didBeginJumpCountDown is broken
Bounty Scanner
Number 935
Number 935
-
- Quite Grand Sub-Admiral
- Posts: 6683
- Joined: Wed Feb 28, 2007 7:54 am
It is broken because in PlayerEntityControls.m, the gal hyper event is triggered as playerStartedJumpCountdown (correct as per wiki), but the standard jump one is triggered as playerStartedJumpCountDown (wrong, has capital D in countdown). It will still work if you make a handler this.playerStartedJumpCountDown, but it certainly needs fixing to conform to both wiki and logic.
The code posted by Frame must be from an older version, the 1.72.1 code does not have the didBeginJumpCountDown anywhere.
Will be commiting the fix shortly. I wish all bugs could be so simple....
The code posted by Frame must be from an older version, the 1.72.1 code does not have the didBeginJumpCountDown anywhere.
Will be commiting the fix shortly. I wish all bugs could be so simple....
hmmm gotta delete that code... sry
Forgot to change paths in Ultra edit...so it searched in the old 1.71.2 code,,,
But I can confirm it works with the capital D for normal witch space
Forgot to change paths in Ultra edit...so it searched in the old 1.71.2 code,,,
But I can confirm it works with the capital D for normal witch space
Bounty Scanner
Number 935
Number 935