Jump to content


Photo

sc#addWmpAre details

dumb as heck

  • Please log in to reply
29 replies to this topic

#1 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 29 March 2014 - 05:45 PM

Hi, I want to do a little thing that'd require adding a fake area directly under Saradush's icon on the ToB worldmap, but either I require more data in my code, or it's just not really working.

 

BEGIN ~sarabutt~
COPY_EXISTING ~ar4000.are~ ~override/L-SAR1.are~

APPEND ~MASTAREA.2da~ ~L-SAR1 value~

LAUNCH_ACTION_FUNCTION sc#addWmpAre
    STR_VAR
        areName = ~L-SAR1~
        strName = ~Saradush~
        strDesc = ~Saradush~
        worldmap = ~worldm25~

    INT_VAR
        mapIcon = 17
        xCoord = 272
        yCoord = 128
        tTime = 3
        inclSv = 1
        reachable = 0
        visited = 0
        visible = 0
        visibleAdjacent = 0

RET areNum = areNum END

END

PRINT "Destroyed Saradush patched, area number: %areNum%"

I thought the problem was in the lack of associative array, but it's not. Lava's worldmap.tph wouldn't work for ToB, would it?



#2 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 30 March 2014 - 01:36 AM

Well, you have one END too many and INT_VARs must come before STR_VARS, which must come before RETs.

 

(areNum is completely worthless by the way. It's not meaningful information to anyone. Also, inclSv makes permanent changes to all saved games. Be sure that is what you want.)


Edited by Wisp, 30 March 2014 - 01:36 AM.


#3 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 30 March 2014 - 02:51 AM

(areNum is completely worthless by the way. It's not meaningful information to anyone. Also, inclSv makes permanent changes to all saved games. Be sure that is what you want.)

It's in the sample code, DAD

(thankss)



#4 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 31 March 2014 - 10:30 AM

(areNum is completely worthless by the way. It's not meaningful information to anyone.

I'd disagree with that! :lol: I asked for it - but I can't remember why now! :ROFL:


Edited by Yovaneth, 31 March 2014 - 10:31 AM.


#5 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 27 May 2014 - 04:27 AM

Necrobumping with a new question.

Does the mapIcon have to come from the mapicons.bam? Be way I see it, there is no way to actually add new icons without overwriting that file.



#6 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 27 May 2014 - 05:50 AM

Okay. One more thing. One final thing, really, because when I get this working the new version of ARP is completely ready to go, but it's a pretty vital bug. I wanted to add a new area to the world map, using this code:

 

INCLUDE ~arp2/worldmap.tph~
// add links from these area(s) to the new area
ACTION_DEFINE_ASSOCIATIVE_ARRAY toNewArea BEGIN
  "AR0020" => "Exitwmp"       // City Gates
  "AR0300" => "Exitwmp"       // Docks
  "AR0400" => "Exitwmp"       // Slums
  "AR0500" => "Exitwmp"       // Bridge District
  "AR0700" => "Exitwmp"       // Waukeen's Promenade
  "AR0800" => "Exitwmp"       // Graveyard
  "AR0900" => "Exitwmp"       // Temple District
  "AR1000" => "Exitwmp"       // Government
  "AR1100" => "Exitwmp"       // Umar Hills
  "AR1300" => "Exitwmp"       // d'Arnise Keep
  "AR1304" => "Exitwmp"       // d'Arnise Keep
  "AR2000" => "Exitwmp"       // Trademeet
  "AR1200" => "Exitwmp"       // Windspear Hills
END

// add links from the new area to these area(s)
ACTION_DEFINE_ASSOCIATIVE_ARRAY fromNewArea BEGIN
  "AR0020" => "ExitNE"      // City Gates
  "AR0300" => "ExitN"       // Docks
  "AR0400" => "ExitN"       // Slums
  "AR0500" => "ExitNE"      // Bridge District
  "AR0700" => "ExitE"       // Waukeen's Promenade
  "AR0800" => "ExitS"       // Graveyard
  "AR0900" => "ExitNW"      // Temple District
  "AR1000" => "ExitN"       // Government
  "AR1100" => "ExitSE"      // Umar Hills
  "AR1300" => "ExitSE"      // d'Arnise Keep
  "AR1304" => "ExitSE"      // d'Arnise Keep
  "AR2000" => "ExitSW"      // Trademeet
  "AR1200" => "ExitW"       // Windspear Hills
END
LAUNCH_ACTION_FUNCTION sc#addWmpAre
INT_VAR
mapIcon = 16
xCoord = 970
yCoord = 638
tTime = 1
inclSv = 1
visible = 0
reachable = 1
visited = 0
visibleAdjacent = 1
STR_VAR
areName = ~ar2700~
strName = ~Ancient Grove~
strDesc = ~Ancient Grove~
worldmap = ~worldmap~
RET areNum = areNum END

EXCEPT it doesn't work. Or rather, works, as in adds the area to the worldmap, and it shows up just fine (except being only reachable from the cities, oh well), exceeept when you go there, the loading screen crashes on you without filling the progress bar. And the opposite, if you use console to get there, and go anywhere else, it also crashes, except this time on like 2/3 of the bar. I assume it's caused by screwed up links, but where exactly?



#7 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 27 May 2014 - 02:23 PM

Info from the warfront: after meddling with some area links, it sometimes loads the area when going from AR2700, and sometimes doesn't. Still not a single success of actually getting it to work while accessing the map. I'm panicking. I really wanted it to be done quickly :(



#8 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 28 May 2014 - 01:04 AM

After changing the links to

 

ACTION_DEFINE_ASSOCIATIVE_ARRAY toNewArea BEGIN
  "AR2600" => "CDExit"    
  "AR1800" => "CDExit"    
  "AR2000" => "CDExit"     
  "AR1304" => "CDExit"    
  "AR1404" => "CDExit"    
  "AR0020" => "CDExit"      
  "AR1300" => "CDExit"
  "AR1400" => "CDExit"    
END

// add links from the new area to these area(s)
ACTION_DEFINE_ASSOCIATIVE_ARRAY fromNewArea BEGIN
  "AR2600" => "CDExit"    
  "AR1800" => "CDExit"    
  "AR2000" => "ExitNW"     
  "AR1304" => "ExitSE"    
  "AR1404" => "ExitE"    
  "AR0020" => "ExitNE"      
  "AR1300" => "ExitSE"
  "AR1400" => "ExitW"
END

aka a literal copy of the north forest links, it doesn't crash on a leave anymore. Still can't get into it.



#9 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 28 May 2014 - 01:31 AM

If this is an area added during the course of the game then you may have hit the same problem as FFT. Make the area show up, then move to another area (any other area), then look at the map again. If the new area is now accessible then yes, it's the same (unsolved) problem.

 

-Y-



#10 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 28 May 2014 - 01:55 AM

It's not about that! The map accessibility is just fine, i e it shows up as accessible when you travel to the Small Teeth Pass just like it was intended, but you can't travel there because the game crashes to hell

 



---------------------Start Logging Session---------------------

ASSERTION FAILED!
File: InfScreenWorldMap.cpp
Line: 3069

Exp: FALSE

Msg: Bad Area file, in area "AR2700" need entry point "CDExit".
Run Debugger?



#11 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 28 May 2014 - 02:18 AM

The error message already tells you what you have to do. Map AR2700 doesn't appear to contain the entrance point "CDExit", so it isn't possible to enter the area without using cheat codes.

The WeiDU function fj_are_structure can easily add new entries to an existing map. Example code:

COPY_EXISTING ~ar2700.are~ ~override~
  PATCH_IF (SOURCE_SIZE > 0x11b) BEGIN
    LPF fj_are_structure
      INT_VAR
      fj_loc_x          = 0   // entrance x coordinate
      fj_loc_y          = 0   // entrance y coordinate
      fj_orientation    = 0   // party's orientation when entering the map
      STR_VAR
      fj_structure_type = entrance
      fj_name           = CDExit
    END
  END


#12 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 28 May 2014 - 02:31 AM

I'm dumb as hell. It works. Let me kiss you on the mouth

 

On the other hand now I have problems with the game crashing when going from this area to adjacent areas with no defined entrances. Jesus christ

 

e: Okay I added a custom entrance point to every worldmap area in the game. That should do it.


Edited by Almateria, 28 May 2014 - 02:47 AM.


#13 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 28 May 2014 - 07:43 AM

You don't want to use CDExit for new entrances (if you are). That's CamDawg's prefix. Additionally, the CDExit entrances are only present if you have Fixpack installed (or another mod mirrors its fixes).

Also, don't INCLUDE worldmap.tph. Use the version that ships with WeiDU.


Edited by Wisp, 28 May 2014 - 07:45 AM.


#14 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 28 May 2014 - 12:57 PM

I didn't, I used my own prefix. I thought the CD meant something else. Danger of 2-letter words I guess. What's wrong with the worldmap.tph?



#15 Mike1072

Mike1072
  • Modder
  • 539 posts

Posted 28 May 2014 - 01:43 PM

Necrobumping with a new question.

Does the mapIcon have to come from the mapicons.bam? Be way I see it, there is no way to actually add new icons without overwriting that file.

There's a stupid function you can use to patch in new icons.  Get it here.  Sample usage is provided earlier in the thread here.



#16 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 31 May 2014 - 05:55 AM

What's wrong with the worldmap.tph?
Rather, why should you use worldmap.tph?

Reasons to not use a non-standard version of a standard function include:
- It will be outdated as soon as a change (e.g., bug fix) is made to the standard function.
- Unless you grabbed the function straight out of WeiDU's sources, it's already outdated.

#17 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 31 May 2014 - 10:23 AM

Wisp - any news on whether the time travel problem has been fixed?



#18 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 31 May 2014 - 10:41 AM

Wisp - any news on whether the time travel problem has been fixed?
Which problem is that?

#19 Almateria

Almateria

    most garbage person

  • Modder
  • 969 posts

Posted 01 August 2014 - 10:26 AM

YO ONE MORE QUESTION pertaining to this very function.

How can I make StrDesc and strName use existing strings? #strings are not accepted, and simply putting numbers doesn't work either.



#20 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 01 August 2014 - 12:14 PM

You can use GET_STRREF.