Home » Fable TLC » Discussion » Level Scripting » Simple Sparring Script Help
Re: Simple Sparring Script Help [message #48172 is a reply to message #48171] |
Mon, 29 December 2008 12:32 |
|
JohnDoe
Messages: 3007 Registered: October 2007
|
Retired
|
|
|
No CDef as DarkenedSoul said. That requires FE and isn't necessary anyway. It's all tng. First you need your teleporter sign:NewThing Object;
Player 4;
UID 00000000000000000000;
DefinitionType "OBJECT_SOMETHING_OR_OTHER";
CreateTC "CTCActionUseScriptedHook";
ScriptName NULL;
ScriptData "Confirmation question goes here.";
ThingGamePersistent FALSE;
ThingLevelPersistent FALSE;
StartCTCPhysicsStandard;
PositionX 0.000000;
PositionY 0.000000;
PositionZ 0.000000;
RHSetForwardX 0.000000;
RHSetForwardY 1.000000;
RHSetForwardZ 0.000000;
RHSetUpX 0.000000;
RHSetUpY 0.000000;
RHSetUpZ 1.000000;
EndCTCPhysicsStandard;
StartCTCTargeted;
Targetable TRUE;
EndCTCTargeted;
StartCTCEditor;
EndCTCEditor;
StartCTCActionUseScriptedHook;
Usable TRUE;
ReversedOnMiniMap FALSE;
HiddenOnMiniMap TRUE;
VersionNumber 1;
ForceConfirmation TRUE;
TeleportToRegionEntrance TRUE;
EntranceConnectedToUID 00000000000000000000;
SoundName "";
AnimationName "";
ReplacementObject 0;
EndCTCActionUseScriptedHook;
Health 1.0;
EndThing; The important parts are the UID, DefinitionType, CreateTC, ScriptData, HiddenOnMiniMap, ForceConfirmation, and EntranceConnectedToUID.
Let's walk through this piece by piece.
The UID is a unique identification number for the object, and needs to be unique to the region, no other anything in the region can have the same UID (and as a good practice, nothing should have the same UID in the game). Luckily, you can punch in any random numbers, 20 digits seems to be standard, and that will almost always be unique (100000000000000000000 possibilities).
The DefinitionType is which OBJECT you'll be using as the teleporter. It can be any OBJECT. You said a sign, let's use "OBJECT_BW_SIGNPOST_PLAQUE_01".
CreateTC. It isn't a teleporter without "CTCActionUseScriptedHook".
ScriptData, this is where "Do you want to spar?" goes.
HiddenOnMiniMap, self-explanatory really. I often prefer to have this set to TRUE to keep it from standing out unless it is a door or other typical teleporter.
ForceConfirmation, you'll want TRUE if you're having the Hero be asked whether or not he wants to.
The EntranceConnectedToUID will be the UID of the teleport destination. I prefer to use this script for destinations:NewThing Marker;
Player 4;
UID 00000000000000000000;
DefinitionType "MARKER_BASIC";
ScriptName NULL;
ScriptData "NULL";
ThingGamePersistent FALSE;
ThingLevelPersistent FALSE;
StartCTCPhysicsStandard;
PositionX 0.000000;
PositionY 0.000000;
PositionZ 0.000000;
RHSetForwardX 0.000000;
RHSetForwardY 1.000000;
RHSetForwardZ 0.000000;
RHSetUpX 0.000000;
RHSetUpY 0.000000;
RHSetUpZ 1.000000;
EndCTCPhysicsStandard;
StartCTCEditor;
EndCTCEditor;
Health 1.0;
EndThing; All that's important here is the UID. The EntranceConnectedToUID in the teleporter must match the UID given for the destination.
Here's the catch, both the teleporter and the destination must be in the same tng (maybe it's same region, but I use the same tng because it's easier to do in my head that way). So if you want to teleport to another map, crack open the FinalAlbion.wld.
Find the starting map and the destination map. Let's say you want to go from the demon door in the Guild to the demon door in Necropolis. The wld gives is this information:NewMap 268;
MapX 4864;
MapY 3392;
LevelName "FinalAlbion\DemonDoor_Guild.lev";
LevelScriptName "DemonDoor_Guild";
MapUID 1350731;
IsSea FALSE;
LoadedOnPlayerProximity TRUE;
EndMap; NewMap 383;
MapX 128;
MapY 7168;
LevelName "FinalAlbion\DemonDoor_Necropolis.lev";
LevelScriptName "DemonDoor_Necropolis";
MapUID 2395802;
IsSea FALSE;
LoadedOnPlayerProximity TRUE;
EndMap; It's just a matter of subtracting the starting coordinates from the destination coordinates.Takeoff map
X = 4864
Y = 3392
Destination
X = 128
Y = 7168
Marker coords
X = 128-4864 = -4736
Y = 7168-3392 = 3776 But that would take the Hero to 0,0 on the map, which is generally a bad thing (you'd understand if you ever saw it). I happen to know that the Necropolis demon door is 64x64, so I could just add 32 to each of the coordinates to throw me smack dab in the middle of the map. But there's a better way to do this, especially if you don't already know the coordinates of the map.
In AE, since that's what you use, place an object in the location you want to teleport to on the map you want to teleport to. Copy the coordinates and add the X and Y coords to the destination marker's coordinates. It works perfectly that way.
Mine would end up like:PositionX -4704.000000;
PositionY 3808.000000; Now, one last note. About the PositionZ values, it is my experience that going too low puts the Hero under the ground, but he finds his way back up (amusing to watch too). If you put him too high, he falls to the ground. While this is cool and all, it looks stupid and gets old after a while. So you'll want to find a good Z value which isn't easy in AE. But, you can take the Z value of something else that will be at the same level that you want the Hero to teleport to. If you want a ground value, for instance, you can take the Z value from something that is on the ground near the teleport destination, and it will work just fine.
[Updated on: Mon, 29 December 2008 13:57] Report message to a moderator
|
|
|
|
|
Simple Sparring Script Help
By: Aarkan on Mon, 29 December 2008 01:17
|
|
|
Re: Simple Sparring Script Help
By: OldBoy on Mon, 29 December 2008 01:58
|
|
|
Re: Simple Sparring Script Help
By: Aarkan on Mon, 29 December 2008 02:50
|
|
|
Re: Simple Sparring Script Help
By: OldBoy on Mon, 29 December 2008 06:25
|
|
|
Re: Simple Sparring Script Help
By: Noctus on Mon, 29 December 2008 09:13
|
|
|
Re: Simple Sparring Script Help
By: OldBoy on Mon, 29 December 2008 09:29
|
|
|
Re: Simple Sparring Script Help
By: Noctus on Mon, 29 December 2008 09:31
|
|
|
Re: Simple Sparring Script Help
By: OldBoy on Mon, 29 December 2008 09:33
|
|
|
Re: Simple Sparring Script Help
By: Noctus on Mon, 29 December 2008 09:35
|
|
|
Re: Simple Sparring Script Help
|
|
|
Re: Simple Sparring Script Help
By: Aarkan on Mon, 29 December 2008 12:21
|
|
|
Re: Simple Sparring Script Help
By: JohnDoe on Mon, 29 December 2008 12:32
|
|
|
Re: Simple Sparring Script Help
By: Aarkan on Mon, 29 December 2008 13:17
|
|
|
Re: Simple Sparring Script Help
By: Noctus on Mon, 29 December 2008 13:43
|
|
|
Re: Simple Sparring Script Help
By: JohnDoe on Mon, 29 December 2008 13:52
|
|
|
Re: Simple Sparring Script Help
By: Aarkan on Mon, 29 December 2008 13:59
|
|
|
Re: Simple Sparring Script Help
By: JohnDoe on Mon, 29 December 2008 14:00
|
|
|
Re: Simple Sparring Script Help
By: Aarkan on Wed, 31 December 2008 21:39
|
Goto Forum:
Current Time: Sat Nov 30 07:11:49 PST 2024
Total time taken to generate the page: 0.17378 seconds
|