Animating Sky

Post Reply
PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Animating Sky

Post by PrBlahBlahtson » 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:

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');
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:

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;
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 :)
Last edited by PrBlahBlahtson on Fri Jan 18, 2013 4:39 am, edited 4 times in total.

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: Animating Sky

Post by PrBlahBlahtson » Wed Jan 16, 2013 8:11 pm

Deviltti sort of dared me in IRC, and I went for it. These are the NPCs for Attohwa.

Sidenotes:
- I haven't checked the NPC IDs. These may replace valid NPCs. That has been left as an exercise for the viewer. The names are the important part.
- Some are gaspionas. I have no idea what those do. The second half will turn off the gas vents on the Tor. Not sure how that can be scripted, though.

Code: Select all

DELETE FROM npc_list WHERE npcid BETWEEN 16806284 AND 16806311;
DELETE FROM npc_list WHERE npcid BETWEEN 16806261 AND 16806282;
INSERT INTO `npc_list` VALUES (16806311, '_i7e', 0, -369.343, -4.062, -73.449, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806310, '_i7d', 0, -435.438, -3.957, -74.171, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806309, '_i7c', 0, -535.904, -12.5, -67.914, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806308, '_i7b', 0, -553.523, -12.223, -72.071, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806307, '_i7a', 0, -233.015, -3.196, -19.049, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806306, '_i79', 0, -330.062, -4.632, -18.832, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806305, '_i78', 0, -397.667, -4, -5.563, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806304, '_i77', 0, -554.739, -3.839, -3.057, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806303, '_i76', 0, -351.916, -4.312, 10.501, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806302, '_i75', 0, -321.902, -12, 36.697, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806301, '_i74', 0, -475.667, -4.017, 37.081, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806300, '_i73', 0, -360.705, -11.74, 51.505, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806299, '_i72', 0, -386, -6, 50, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806298, '_i71', 0, -351.717, -11.947, 64.773, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806297, '_i70', 0, -369.333, -11.766, 69.333, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806296, '_07z', 0, -367.892, -11.618, 75.774, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806295, '_07y', 0, -393.979, -4.597, 101.877, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806294, '_07x', 0, -537.558, -5, 102.683, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806293, '_07w', 0, -382.919, -5, 143.572, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806292, '_07v', 0, -396.844, -4.133, 164.79, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806291, '_07u', 0, -514, -4, 166, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806290, '_07t', 0, -595.756, -4.075, 157.532, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806289, '_07s', 0, -482.192, -4, 198.647, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806288, '_07r', 0, -530, -4.075, 210, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806287, '_07q', 0, -534.104, -4.815, 217.833, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806286, '_07p', 0, -388.027, -4.955, 264.831, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806285, '_07o', 0, -440.938, -4, 281.749, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806284, '_07n', 0, -475.809, -3.99, 316.499, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806282, '_07m', 0, 344.885, 9.062, -110.361, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806281, '_07l', 0, 254.521, 2.499, -89.093, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806280, '_07k', 0, 255.478, 0.073, -44.986, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806279, '_07j', 0, 384.57, 0.247, -5.074, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806278, '_07i', 0, 255.61, -4.737, 30.838, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806277, '_07h', 0, 289.334, -3.832, 65.105, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806276, '_07g', 0, 249.962, 19.5, -211.41, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806275, '_07f', 0, 308.892, 19.335, -172.755, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806274, '_07e', 0, 370.981, 19.56, -146.765, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806273, '_07d', 0, 299.607, 19.417, -129.874, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806272, '_07c', 0, 405.111, 20.142, -102.201, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806271, '_07b', 0, 451.404, 19.731, -7.137, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806270, '_07a', 0, 417.955, 19.393, -8.507, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806269, '_079', 0, 217.745, 20.302, 0.609, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806268, '_078', 0, 259.31, 19.776, 82.644, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806267, '_077', 0, 487.807, 20.007, 89.238, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806266, '_076', 0, 358.292, 20.534, 102.429, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806265, '_075', 0, 310.88, 19.5, 109.437, 1, 40, 40, 9, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806264, '_074', 0, -480.312, -3.573, 100.942, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806263, '_073', 0, -442.817, -3.706, 180.529, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806262, '_072', 0, -509.371, -4.5, 190.812, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);
INSERT INTO `npc_list` VALUES (16806261, '_071', 0, -567.55, -4.5, 168.221, 1, 40, 40, 8, 0, 0, 0, 6147, 0x0200000000000000000000000000000000000000, 0, 7);

Zedingo
Developer
Posts: 85
Joined: Tue Aug 14, 2012 12:24 pm

Re: Animating Sky

Post by Zedingo » Thu Jan 17, 2013 9:48 am

Gasponias are the flowers in Attohwa that have a cloud effect of sorts. They induce poison when you get too close, like the Afflictor in Beadeaux.

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: Animating Sky

Post by PrBlahBlahtson » Thu Jan 17, 2013 12:43 pm

Yeah, I just wasn't sure why they merited having NPCs. Turns out if you animate them, you get the green poison cloud.

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Animating Sky

Post by whasf » Thu Jan 17, 2013 6:45 pm

DO you guys just want commit access so i don't have to keep adding your work?? :D
-- Whasf

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: Animating Sky

Post by PrBlahBlahtson » Sat Jan 19, 2013 7:02 pm

Another day, another zone. These ones are... odd. Ro'Maeve has performance anxiety. You frequently have to walk away from the target a fair distance, and it's changed when you come back. A watched pot literally never boils.

The upper bridge will animate just fine, and can sometimes be walked across, but occasionally glitches.

The lower bridge seems to stay impassible and is more likely to completely disappear than the upper bridge. They're still there, but... yeah, that's not right.

Typical disclaimer; npc id, flag, position, etc may not be correct. It's assumed you know what you're doing.

Code: Select all

INSERT INTO `npc_list` VALUES ('17277171', '_3e0', '0', '184.516', '-7.146', '14.297', '1', '40', '40', '9', '0', '0', '0', '4099', 0x0200000000000000000000000000000000000000, '0', '122'); -- Moongate, correct pos/ID
INSERT INTO `npc_list` VALUES ('17277172', '_3e1', '0', '-184.516', '-7.146', '14.298', '1', '40', '40', '9', '0', '0', '0', '4099', 0x0200000000000000000000000000000000000000, '0', '122'); -- Also moongate, correct pos/ID
INSERT INTO `npc_list` VALUES ('17277174', '_3e4', '0', '0.001', '-8', '-104', '1', '40', '40', '9', '0', '0', '0', '4099', 0x0200000000000000000000000000000000000000, '0', '122'); -- Lower Bridge
INSERT INTO `npc_list` VALUES ('17277175', '_3e5', '0', '0.001', '-27.402', '29', '1', '40', '40', '9', '0', '0', '0', '4099', 0x0200000000000000000000000000000000000000, '0', '122'); -- Upper bridge
INSERT INTO `npc_list` VALUES ('17277177', '_3e7', '0', '0.001', '-8', '-104', '1', '40', '40', '9', '0', '0', '0', '4099', 0x0200000000000000000000000000000000000000, '0', '122'); -- Qu'Hau Fountain
I suppose they could be rigged to work via automatisation.lua, with a check of lunar phase (waxing 90% to waning 95%) and weather at 0:00, then openDoor(432); (2 minutes 24 seconds per vana'diel hour, everything is open from 0:00 to 3:00 if conditions are met.)

Edit:
I put together a rough automatisation entry for the doors. They're supposed to open from Waxing 95% to Full 100% and back down to Wanning 90%. The current VanadielMoonPhase() seems like it may just be returning the percentage, which means it isn't retail.

Also found these:

Code: Select all

INSERT INTO `npc_list` VALUES ('17617179', '_5p0', '0', '193.967', '-0.400', '19.492', '32769', '40', '40', '9', '0', '0', '0', '3', 0x0200000000000000000000000000000000000000, '0', '205'); -- Flame spout @pos 193 0 19 205
INSERT INTO `npc_list` VALUES ('17617180', '_5p1', '0', '-206.184', '-0.700', '-59.797', '32769', '40', '40', '9', '0', '0', '0', '3', 0x0200000000000000000000000000000000000000, '0', '205'); -- Flame spout @pos -206 0 -59 205
INSERT INTO `npc_list` VALUES ('17617181', '_5p2', '0', '-171.395', '38.228', '60.805', '32769', '40', '40', '9', '0', '0', '0', '3', 0x0200000000000000000000000000000000000000, '0', '205'); -- Flame spout @pos -171 38 60 205
INSERT INTO `npc_list` VALUES ('17617182', '_5p3', '0', '-340.646', '38.928', '188.666', '32769', '40', '40', '9', '0', '0', '0', '3', 0x0200000000000000000000000000000000000000, '0', '205'); -- Flame spout @pos -340 39 188 205
NPC IDs are probably wrong, as is the flag/unknown data. These seemed to be at least vaguely position sensitive, so the names and coordinates are vital. They'll drop with an animation 8, so if any core programmers has an idea for how to schedule an openDoor() to run every 3 game hours, I'm all ears. :)

I also need to run a few tasks related to the Bastok airship, which is a little more complicated. Airship arrives every 6 hours, at 13 after, and debates 59 game minutes later.

Might be able to sneak them in using the current FlameSpout NPC IDs, but then you'd have 4 scripts handling the flame spouts. There's a gap of 3 between the treasure caskets and flame spouts, and a gap of 5 between Altar of Ashes and a ???.

Post Reply