Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Page 2 of 2 1 2
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Thanks LL.

I will take your recommendation, and read up on this.

I just finished spending a lot of time building out some quests that included a specific gold amount to return the quest giver and thanks to you. I got that all working.

I now understand how that works intimately, thanks again to your teaching ability!

Anyway back to corpse removal. Its a little dry...

Hopefully, I can have some POC working soon to share.

Its a nice deign feature. It looks clunky haveing corpse's everywhere. But during balance testing you can live with it fer now.

Last edited by Detect; 07/03/18 12:33 AM.
Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
No worries Detect. Keep at it and I'm sure scripting will start to make more sense. smile And feel free to ask questions, of course.

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
spending some time on this , getting an error:

auto-define Osiris"DB_MonkWorks_SpawnedEnemies"(): Failed: type of parameter 1 unknown



Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
That errors means the first parameter's type for that database hasn't been defined anywhere.

Here's an example of the first parameter's type not being defined (and the value isn't defined either):
Code
PROC
MyMod_AddEnemy((CHARACTERGUID)_Enemy)
THEN
DB_MonkWorks_SpawnedEnemies(_Level, _Enemy);

Here you can see the type for _Enemy is defined, while _Level is an unknown value and type.

This:
Code
PROC
MyMod_AddEnemy(((STRING)_Level, (CHARACTERGUID)_Enemy)
THEN
DB_MonkWorks_SpawnedEnemies(_Level, _Enemy);

Or this:
Code
PROC
MyMod_AddEnemy((CHARACTERGUID)_Enemy)
THEN
DB_MonkWorks_SpawnedEnemies("None", _Enemy);// "None" is a STRING

Will compile correctly.

Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
That's the general idea of that kind of error. Not sure what's causing the error in your code specifically, since you didn't post the script context of the error.

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
You nailed it. Needed to define it. Thanks, testing onward smile

Last edited by Detect; 19/03/18 05:13 PM.
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
PROC
MonkWorks_System_Cleanup()
AND
DB_MonkWorks_SpawnedEnemies(_Type, _Enemy) <<<<<error
THEN
SetOnStage(_Enemy, 0);
NOT DB_MonkWorks_SpawnedEnemies(_Type, _Enemy);

PROC
MonkWorks_System_Cleanup()
AND
NOT DB_MonkWorks_SpawnedEnemies(_, _) <<<<<error
THEN
NOT DB_MonkWorks_CleanupRunning(1);

Not sure... type, enemy not defined

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
It's not clear to the compiler whether the contents of your database are items, characters, triggers, or general GUIDSTRINGs.

As LaughingLeader said above, you'll have to explicitly state whether those are (CHARACTERGUID), (STRINGS), etc...

Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
Right. Make sure the _Enemy column is defined somewhere. The easiest way to do this for a dynamically-created database (one that's added to when needed, rather than being declared in the INIT section) is to use a procedure, as this will set up the correct types with the compiler:

Code
PROC
MonkWorks_AddEnemy((STRING)_Type, (CHARACTERGUID)_Enemy)
THEN
DB_MonkWorks_SpawnedEnemies(_Type, _Enemy);

IF
StoryEvent((CHARACTERGUID)_Player, "MonkWorks_Events_CreateEnemy_Zone1")
AND
TemporaryCharacterCreateOutOfSightToObject("MonkWorks_Enemy_Ghoul01_36662d44-3f2b-4f50-bfe3-99fe5203090e", _Player, ITEMGUID_SpawnPortalGlow_Zone1_6e363764-eb26-4b49-98a8-df99d6965049, 1, "MonkWorks_Events_GhoulCreated", _Ghoul)
AND
CharacterGetLevel(_Player, _PlayerLevel)
THEN
CharacterLevelUpTo(_Ghoul, _PlayerLevel);
MonkWorks_AddEnemy("Ghoul", _Ghoul);


Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
Just using
PROC
MonkWorks_System_Cleanup()
AND
DB_MonkWorks_SpawnedEnemies((STRING)_Type, (CHARACTERGUID)_Enemy)
THEN
SetOnStage(_Enemy, 0);
NOT DB_MonkWorks_SpawnedEnemies(_Type, _Enemy);

should work too, though. You may need to cast some variables to CHARACTERGUIDs where they were GUIDSTRINGS before, but you'd have to do that either way.

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Thanks guys. I am like a blind person here, fumbling through. I really should not be pretending I know stuff because I don't. I have many years working on the fringe of software development so I understand a lot about computer languages as a generalist, master of none, knowledge of many. So please forgive me. I am reaching out for help because I don't have the skills to do this, its not like I am reaching out as a scripter trying to get peer support. I have been very lucky that LL provided his script to mess around with. I can continue the development life-cycle of the script and maybe get it tested , again sharing with all who need this in the community.

I may have already said this type of script in previous /similar games was already there. We didn't need to develop the script. All we had to do was call it from OnEnter. Even had a timer type feature. Clean up the level every 30 sec or 30mins. But I do remember it being a very large script more then 200 lines IIRC.

ok back to my thickness-

"As LaughingLeader said above, you'll have to explicitly state whether those are (CHARACTERGUID), (STRINGS), etc..."

I think what your trying to tell me is I need to define the actual GUID? full string?
"CHARACTERGUID_Monkworks_BurningWitch000_93ddbfeb-f625-468a-bd4f-dd573ebca214"


"The easiest way to do this for a dynamically-created database (one that's added to when needed, rather than being declared in the INIT section) is to use a procedure, as this will set up the correct types with the compiler:"

I think you mean we can add a short word that will point to:
"CHARACTERGUID_Monkworks_BurningWitch000_93ddbfeb-f625-468a-bd4f-dd573ebca214"
, 1, "BurnWitch0" <<<

But were is the DB declaration for BurnWitch0? Like were is "BurnWitch0" stored?

Let me know if I am anywhere close to understanding the concept here, feel like I'm way off still.

Last edited by Detect; 20/03/18 10:55 PM.
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
The script complies now.
Quote

INIT--

//beta - (Big thanks to LaughingLeader)
//Replace this with your actual trigger
DB_MonkWorks_LevelTransitionTrigger((TRIGGERGUID)LevelTransition_Level1_bdc5b3da-041a-4d98-bb68-149869203e83);

KB--

IF
CharacterEnteredTrigger(_Character, _Trigger)
AND
DB_IsPlayer(_Character)
AND
DB_MonkWorks_LevelTransitionTrigger(_Trigger)
AND
NOT DB_MonkWorks_CleanupRunning(_)
AND
MonkWorks_QRY_CleanupNeeded()
THEN
DB_MonkWorks_CleanupRunning(1);
MonkWorks_System_Cleanup();

QRY
MonkWorks_QRY_CleanupNeeded()
AND
SysCount("DB_MonkWorks_SpawnedEnemies", 2, _TotalEnemies)
AND
_TotalEnemies > 0
THEN
DB_NOOP(1);

PROC
MonkWorks_System_Cleanup()
AND

/* Thanks LarIlya!! :)*/
DB_MonkWorks_SpawnedEnemies((STRING)_Type, (CHARACTERGUID)_Enemy)
//

THEN
SetOnStage(_Enemy, 0);
NOT DB_MonkWorks_SpawnedEnemies(_Type, _Enemy);

PROC
MonkWorks_System_Cleanup()
AND
NOT DB_MonkWorks_SpawnedEnemies(_,_)
THEN
NOT DB_MonkWorks_CleanupRunning(1);



OK let me go and get a test area set up to see if we can get/see some working clean ups

Last edited by Detect; 20/03/18 11:10 PM.
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Nothing to report. Test area set up. a few rats that I spawn and kill. I hit the Tigger and the corpse remain. I understand much more need to be built in here.

Page 2 of 2 1 2

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5