Jump to content

Photo

Detect SoD via Trigger


9 replies to this topic

#1 Skye

Skye
  • Members
  • 147 posts
  • Gender:Female
  • Location:Wonderland

Posted 03 July 2018 - 12:14 PM

I'm trying to make my life easier, so I was wondering if anyone knows of a clever trigger that would allow me to determine if SoD is installed while in-game.

 

I know I can do it during mod installation, but I'd prefer to avoid having to override my triggers while I'm compiling the scripts.



#2 Endurium

Endurium
  • Members
  • 32 posts
  • Gender:Male

Posted 03 July 2018 - 08:30 PM

Try this:

AreaCheckObject("bd0120","bdporios")

Should return True if both the area "bd0120" and creature in that area "bdporios" exist; they are SoD specific (the starting area). If SoD is not installed neither of them will exist and the trigger should return False (and the script compiler may throw warnings that resources don't exist).


Edited by Endurium, 03 July 2018 - 08:59 PM.


#3 argent77

argent77
  • Modders
  • 823 posts
  • Gender:Male

Posted 04 July 2018 - 01:38 AM

Try this:

AreaCheckObject("bd0120","bdporios")

Should return True if both the area "bd0120" and creature in that area "bdporios" exist; they are SoD specific (the starting area). If SoD is not installed neither of them will exist and the trigger should return False (and the script compiler may throw warnings that resources don't exist).

It didn't work in my tests. From what I've seen in existing scripts, this trigger is only used to check for creatures in the same area.

An idea that *might* work (haven't tested yet):
- spawn a SoD-specific creature (preferably one without assigned scripts)
- use ActionOverride to execute a simple script action from the spawned creature (e.g. setting a variable)
- despawn the creature
- check if the variable has been set
 



#4 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Modders
  • 6787 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 04 July 2018 - 03:11 AM

An idea that *might* work (haven't tested yet):
- spawn a SoD-specific creature (preferably one without assigned scripts)
- use ActionOverride to execute a simple script action from the spawned creature (e.g. setting a variable)
- despawn the creature
- check if the variable has been set

Or you could use simple, if game SoD in weidu, append baldur.bcs via set global x to z, and check for global x is z there after. But, that's like ...

Edited by Jarno Mikkola, 04 July 2018 - 03:12 AM.

Welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand.
Here's how to install all the ... mods you ever really could want to Infinity Engine games. I removed the stable word from there as Roxanne began to add BS mods that are likely to break compatibility from the BWS.

#5 Endurium

Endurium
  • Members
  • 32 posts
  • Gender:Male

Posted 04 July 2018 - 05:37 AM

It's a shame Beamdog didn't add a HasCampaign trigger to go with their HasDLC trigger (which checks DLC companions)

 

I suspected AreaCheckObject might not work but after seeing it in Baldur.bcs I figured maybe... alas.

 

Jarno's idea works best if you're installing with WeiDU anyway. No need to override triggers if you've got a global variable you can check at any time, from any place.


Edited by Endurium, 04 July 2018 - 05:41 AM.


#6 Skye

Skye
  • Members
  • 147 posts
  • Gender:Female
  • Location:Wonderland

Posted 04 July 2018 - 08:17 AM

Yeah, that was my next idea as well. It's better than editing my triggers, I guess.



#7 Avenger

Avenger
  • Modders
  • 3803 posts
  • Gender:Male
  • Location:Hungary

Posted 04 July 2018 - 01:41 PM

I don't know if this helps.

 

On windows, SetPrivateProfileString('DLC','dlcname','0')  

disables a dlc (HasDLC('dlcname') will return false). Sadly this won't work on tablets or linux.

 

You can even use this cmd in the console. (without the leading C: prefix)



#8 Endurium

Endurium
  • Members
  • 32 posts
  • Gender:Male

Posted 04 July 2018 - 07:10 PM

Can't hurt for her to try but I don't know if it will help because the game doesn't classify SoD or BP as DLC, but rather Campaigns

 

From BGEE.LUA with SoD installed:

Infinity_AddDLC( 'dorn', 'DLCDN', 31092, 31093, 'BGEE_IOS_DORN', 'baldursgate_android_dorn' )
Infinity_AddDLC( 'neera', 'DLCNE', 31090, 31091, 'BGEE_IOS_NEERA', 'baldursgate_android_neera' )
Infinity_AddDLC( 'manley', 'DLCP1', 31094, 31095, 'BGEE_IOS_PORTRAITPACK1', 'baldursgate_android_portraitpack1' )
Infinity_AddDLC( 'voice', 'DLCV1', 31096, 31097, 'BGEE_IOS_VOICEPACK1', 'baldursgate_android_voicepack1' )

...

	START_CAMPAIGN_BG = 1,
	START_CAMPAIGN_BP = 2,
	START_CAMPAIGN_SOD = 3,

Also when Sarevok dies and SoD is installed, the cutscene executes a MoveToCampaign("SoD") action referring to Campaign.2da which has all the necessary map/resource switches.

 

All uses of HasDLC() in script refer to the BeamDog companions.



#9 Ardanis

Ardanis

    A very GAR character

  • Modders
  • 2613 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 05 July 2018 - 08:53 AM

Pretty sure HasDLC("SOD") is supposed to do what it says on the tin.


Retired from modding.


#10 Avenger

Avenger
  • Modders
  • 3803 posts
  • Gender:Male
  • Location:Hungary

Posted 06 July 2018 - 01:15 PM

Pretty sure HasDLC("SOD") is supposed to do what it says on the tin.

 

Sadly no.  HasDLC("nosuchthis")    returns true.

You need to have a DLC variable set to 0 to actually get any negative result.

 

And that's what you can do with SetPrivateProfileString('DLC','dlcname','0')  


Edited by Avenger, 06 July 2018 - 01:17 PM.




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users