Aller au contenu

Photo

OpenFadeMap() for a custom map (Solved - kind of)


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
Hi,

Has anybody managed to get their own custom fade map working for a standalone module? All I've managed to get is all the locations blinking on it.
*click to enlarge*
Image IPB

Debugging it through the UI, it thinks that I have no locations/pins in the map - at least the UI attribute "WorldMap.FadeMap.Locations" returns zero from the game engine, so it's basically all uninitialized. Edit: If I call OpenPrimaryWorldMap() instead of OpenFadeMap() then the pins appear, but for the wrong type of map of course. The node graphics in the fade map are (I believe) somewhat hardcoded, but I can't get them initialized, for all intents.

My DAScript can find the map object and pins (which have an active or greyed out initial state). I even created a custom worldmaps 2DA for another fade map and its transition-waypoints to another test area.

This is basically what I'm trying in script so far... I can't really see what I'm doing wrong compared to the Broken Circle quest scripts.

object oPrimaryMap = GetObjectByTag("test_fademap"); //  Returns a valid object. Test fade map
object oSecondaryMap = GetObjectByTag("test_wow"); // Returns a valid object. Wide open world
WR_SetWorldMapPrimary(oPrimaryMap);
WR_SetWorldMapSecondary(oSecondaryMap);

// Not sure if this would make a difference, but trying it anyway
/////////////////////////////////////////////////////////////////////////////////////////////////
object oStartPin = GetObjectByTag("wml_fad_test_pin1"); // Returns a valid object. Pin state is "active".
WR_SetWorldMapPlayerLocation(oPrimaryMap, oStartPin);
SetWorldMapGuiStatus(WM_GUI_STATUS_USE);
/////////////////////////////////////////////////////////////////////////////////////////////////
//

if (IsObjectValid(oMap) && IsObjectValid(oStartPin))
{
    OpenFadeMap();
}


Modifié par FollowTheGourd, 21 juillet 2010 - 04:37 .


#2
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
I figured it out for the most part.
  • You must name your map resource fade_map.map. The single player campaign already has a resource of that name, so I suppose you'll have to rename it after exporting. The tag doesn't matter, just provide the correct one to GetObjectByTag() before you call WR_SetWorldMapPrimary. You don't need to call SetWorldMapGuiStatus(WM_GUI_STATUS_USE) either.
  • Export your talk table, even if just testing. Apparently you can get away with not doing that for testing the world map but not the fade map.
The resource name is definitely hardcoded - besides verifying that fade_map.map works and anything else doesn't, if you alter the single player campaign and take out the call to WR_SetWorldMapPrimary or set it to another map, then OpenFadeMap will still open the fade_map.map resource, even though transitions won't work.

Modifié par FollowTheGourd, 21 juillet 2010 - 04:45 .


#3
FergusM

FergusM
  • Members
  • 460 messages
Have you been able to activate/deactivate the lines between the nodes? What about placing pins in random places? I struggled with this myself awhile ago and gave up, so news of progress is interesting.

#4
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
I'd have to check again, but I think the lines and all that is hardcoded into the UI, depending on which nodes are in a completed state. And the pin locations are fixed as well, as far as I can tell.

I don't know what happens if you have less than or greater than 10 pins, but I suspect > 10 and you won't see a difference, < 10 and maybe you'll get some blinking nodes (maybe, the UI script does check how many there are, but when it was zero all the nodes were blinking).

I'll look at it all again tomorrow and see if I can't give a proper write up of its behaviour.

Modifié par FollowTheGourd, 21 juillet 2010 - 05:19 .


#5
FollowTheGourd

FollowTheGourd
  • Members
  • 572 messages
So here's some more information I tortured out of the UI (I still need to confirm it's right, but it makes sense for the most part). I should probably redo this as a chart of what lines come out of what node. Also, if you want the animation when the map changes state, generally you have a previous state that made these conditions false (and I think you had to have opened the fade map previously for that to get stored) - still need to verify all this.

More importantly: I still need to determine how pins are indexed by the engine - is it just in order of their appearance in the GFF and is that the same order as the order they're created in the toolset's map editor?

First as a reference here's my poorly labelled fade map:
*click to enlarge*
Image IPB

When the lines are shown (as determined by map pin states):
Lock:
Line 0: When Node 1 is not greyed out.

Ring:
Lines 1 to 5: When Node 5 is not greyed out. Why node 5??? Then again, it might as well be. Verify this.

Nightmares:
Line 6: When Node 2 is other than "not active" and Node 6 is completed.
Line 7: When Node 2 is other than "not active" and Node 8 is completed.
Line 8: When Node 3 is other than "not active" and Node 8 is completed.
Line 9: When Node 3 is other than "not active" and Node 7 is completed.
Line 10: When Node 4 is other than "not active" and Node 7 is completed.
Line 11: When Node 4 is other than "not active" and Node 5 is completed.

Lines connecting to the centre point. Apparently it doesn't care about Node 9's state. Is that right?
Line 12: When Node 1 is completed.
Line 13: When Node 5 is completed.
Line 14: When Node 7 is completed.
Line 15: When Node 8 is completed.
Line 16: When Node 6 is completed.

Demon:
Note: Is DemonInit() called by the engine or somewhere? I don't see where this function is called from, but see if any line appears when Nodes 1, 5, 6, 7, and 8 are all completed.

Modifié par FollowTheGourd, 22 juillet 2010 - 05:54 .