Animating Sky
Posted: Tue Jan 15, 2013 9:26 pm
So I'm trying to focus on CoP, and thought someone else might want to take this and run with it.
I sorta made Pincerstones animate.
I'm still not completely certain what makes it work, but I've got a better idea now. Here's what I've learned:
- NPC ID doesn't seem to matter. You can use an ID that's meant for another NPC, and it'll still work. I used 17310104 ("Planar Rift") for my test of this without any trouble.
- NPC position doesn't have to be perfect for this to work, but does change where the effect appears.
- NPC name is absolutely important, and may affect what you get when you animate it.
- The required NPC names do not necessarily match what you find in POLUtils.
To recreate the screenshot above, use this NPC:
The NPC needs to receive animation 8, which you can achieve by editing the pincerstone to either:
GetNPCByID(17310013):setAnimation(8);
Or...
GetNPCByID(17310013):openDoor(30);
The first will make the effect appear and stay until the server is reset. The second will make the effect appear for 30 seconds, and then disappear.
With these NPCs, I've only seen flag values of 1, a default animation of 9 (Off/closed), an "Unknown" of 6147, and look data of 0x02. I got the proper name from PXI, and didn't realize it would matter while I was doing it.
How do you find these NPCs?
In Promyvions, they're actually listed in POLUtils, if you know where to look. warp_01, warp_02, etc. Those are easy, and already in the database. The problem is that the names in POLUtils are wrong, and these will not work if you use those names. POLUtils lists "warp_01" for 16843048, but using warp_01 in Darkstar will prevent the effect from working. Changing it back to _0g1 will fix it.
In Sky, the NPCs aren't even listed. NPC 108214F falls between two existing NPCs, but is not actually present. Since I've found that NPC IDs don't seem to matter, those gaps are prime territory for plopping the NPCs Darkstar will need for this sort of thing. I imagine making the gates between the islands glow will require the same trick on a different NPC name.
This is the code I use for @animatenpc, if anyone wants the function:You'll also need to add a line that accepts two strings or integers in commands.conf. I haven't tested it on mobs, but its sister function @gotonpc will crash your server if you use it on a mobid.
Edit 3:
Decided to clean up the post a bit with what I've learned. I sort of threw it together in a rush. It should be more logical now.
_3m0 sounds like a door opening, but produced no visible effect.
_3m1, 3, 4, 5, and 6 had no apparent sound or visual effect when I tested them.
It occurs to me that these may only work when they're reasonably close to what they're supposed to affect, or that they need animation codes other than 8 and 9.
Edit 4:
These animation effects are kind of interesting to me. I fall back to tinkering when I need a mental break.
I'll add anything interesting I come across to this edit.
The names seem to be zone dependent. That is, you can't put a _3m2 in Ru'Lude Gardens and make it glow.
PXI had _3m0, _3m1, and _3m3 near the door into RuAvitau. _3m0 opens the top of the door, while 1 and 3 are the sides.
_3mc is the glow for portals between the islands.
_3mm is the glow for God islands.
Port Bastok: The bridge is 17743958. Animation 9 is bridge up, animation 8 is bridge down. I think that's going to have to be done in the core. Event 70 seems to handle both sides of the bridge, and sorts out where you need to be sent to.
Came back to my old nemesis, the ZM5 cutscene. Zone 160's NPCs are named _4g#. 10 numbers, 26 letters. (4*36) + 10 + 7 (g) = 161. Adjust for there being a zone 0 and you have 160. Base 36, with a single digit to differentiate in-zone. Does not explain the _mi# in Zone 162 though
I sorta made Pincerstones animate.
I'm still not completely certain what makes it work, but I've got a better idea now. Here's what I've learned:
- NPC ID doesn't seem to matter. You can use an ID that's meant for another NPC, and it'll still work. I used 17310104 ("Planar Rift") for my test of this without any trouble.
- NPC position doesn't have to be perfect for this to work, but does change where the effect appears.
- NPC name is absolutely important, and may affect what you get when you animate it.
- The required NPC names do not necessarily match what you find in POLUtils.
To recreate the screenshot above, use this NPC:
Code: Select all
INSERT INTO `npc_list` VALUES ('17310031', '_3m2', '0', '49.756', '-32', '-371.395', '1', '40', '40', '9', '0', '0', '0', '6147', 0x0200000000000000000000000000000000000000, '0', '130');
GetNPCByID(17310013):setAnimation(8);
Or...
GetNPCByID(17310013):openDoor(30);
The first will make the effect appear and stay until the server is reset. The second will make the effect appear for 30 seconds, and then disappear.
With these NPCs, I've only seen flag values of 1, a default animation of 9 (Off/closed), an "Unknown" of 6147, and look data of 0x02. I got the proper name from PXI, and didn't realize it would matter while I was doing it.
How do you find these NPCs?
In Promyvions, they're actually listed in POLUtils, if you know where to look. warp_01, warp_02, etc. Those are easy, and already in the database. The problem is that the names in POLUtils are wrong, and these will not work if you use those names. POLUtils lists "warp_01" for 16843048, but using warp_01 in Darkstar will prevent the effect from working. Changing it back to _0g1 will fix it.
In Sky, the NPCs aren't even listed. NPC 108214F falls between two existing NPCs, but is not actually present. Since I've found that NPC IDs don't seem to matter, those gaps are prime territory for plopping the NPCs Darkstar will need for this sort of thing. I imagine making the gates between the islands glow will require the same trick on a different NPC name.
This is the code I use for @animatenpc, if anyone wants the function:
Code: Select all
function onTrigger(player, target, anim)
if (target ~= nil) and (anim ~= nil) then
local oldanim = GetNPCByID(target):getAnimation();
GetNPCByID(target):setAnimation(anim);
printf("NPC ID: %i | Old Anim: %i | New Anim: %i",target,oldanim,anim);
end
end;
Edit 3:
Decided to clean up the post a bit with what I've learned. I sort of threw it together in a rush. It should be more logical now.
_3m0 sounds like a door opening, but produced no visible effect.
_3m1, 3, 4, 5, and 6 had no apparent sound or visual effect when I tested them.
It occurs to me that these may only work when they're reasonably close to what they're supposed to affect, or that they need animation codes other than 8 and 9.
Edit 4:
These animation effects are kind of interesting to me. I fall back to tinkering when I need a mental break.
I'll add anything interesting I come across to this edit.
The names seem to be zone dependent. That is, you can't put a _3m2 in Ru'Lude Gardens and make it glow.
PXI had _3m0, _3m1, and _3m3 near the door into RuAvitau. _3m0 opens the top of the door, while 1 and 3 are the sides.
_3mc is the glow for portals between the islands.
_3mm is the glow for God islands.
Port Bastok: The bridge is 17743958. Animation 9 is bridge up, animation 8 is bridge down. I think that's going to have to be done in the core. Event 70 seems to handle both sides of the bridge, and sorts out where you need to be sent to.
Came back to my old nemesis, the ZM5 cutscene. Zone 160's NPCs are named _4g#. 10 numbers, 26 letters. (4*36) + 10 + 7 (g) = 161. Adjust for there being a zone 0 and you have 160. Base 36, with a single digit to differentiate in-zone. Does not explain the _mi# in Zone 162 though
