Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#544042 15/08/14 12:13 PM
Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
I've spent the morning getting a lever to function as a door opening switch (incidentally, a process that proved to be far more difficult than I expected it to be, ha).

My next step is to make that lever apply the 'Stunned' status to whichever character uses it.

Easy right?

My code:
Code
IF
CharacterItemEvent(_Player,ITEM_EFS_ChestLeverOut,"ChestDoorOut")
THEN
CharacterApplyStatus(_Player,"STUNNED",10.0);
CharacterPlayEffect(_Player,"FX_GP_Death_Lightning_A_Medium");


The lightning FX plays correctly. No status change whatsoever.


So I go to look at the code used for the Black Cove area with the dozen different 'fun' buttons.

From the Main campaign Story Editor:
Code
IF
CharacterItemEvent(_Player, ITEM_CYS_BC_LeverPretty, "activated")
THEN
CharacterPlayEffect(_Player, "FX_GP_Death_Lightning_A_Medium");
CharacterSetHitpointsPercentage(_Player, 1);
CharacterApplyStatus(_Player, "STUNNED", 18.0);
CharacterDisplayText(_Player, "GLO_ObviousActivated");


That's... very similar!


Can anyone enlighten me as to why I can't manually apply a status effect?

I've double checked the lever/button itself on the Black Cover map and I can see nothing special about it.


Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Jul 2014
Location: Finland
journeyman
Offline
journeyman
Joined: Jul 2014
Location: Finland
Try to use "Stun" instead of "STUNNED". See the status types in ValueList.xslm

If the "Stun" works then there appears to be a bug in main campaign.

Last edited by BioSpirit; 15/08/14 12:54 PM.
Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
No joy, sad to say. 'Stun' doesn't work either.

I should have mentioned, I'd already tested it with "Burning" (since I know the game recognises that, having already used it in a 'IF CharacterStatusChange' event). It didn't apply burning either. It feels like the code's correct but there's some associated prep work I'm missing.

The reason I went and looked at the lever itself in Black Cove is because I recall reading something on these forums about how potions have their own 'CharacterApplyStatus'-effecting values, inserted into their itemscript (I think?), which governs the potency/etc. of said status. I wouldn't have thought that just a general 'apply this status to this character' request from Story Editor would need something like that, but, well, I'm running out of reasons to explain the non-reponse. Could there be some other set-up which needs to occur for the status change to fire (or, in this case, spark)?

Last edited by Noaloha; 15/08/14 01:46 PM.

Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Jul 2014
Location: Finland
journeyman
Offline
journeyman
Joined: Jul 2014
Location: Finland
Yes, it looks like "Stun" is incorrect.

I just tested this and it seems to be working. Maybe you need to define the Force parameter as well.

Quote

IF CharacterEnteredTrigger(_Player, TRIGGER_HUS_ChatTrigger)
THEN CharacterApplyStatus(_Player, "STUNNED", 6.0, 15);


EDIT: I just tested without the Force parameter and it is still working.

Last edited by BioSpirit; 15/08/14 03:39 PM.
Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
Okay, so it's just yet another thing that's screwed up with my folders. I really should have known. frown

Thanks for taking a moment to check that for me Bio, it saved me a bunch of time and misplaced concern.


Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Jul 2014
Location: Finland
journeyman
Offline
journeyman
Joined: Jul 2014
Location: Finland
My mod is an extension to the main campaign. It has a dependency to the "Main". I have never copied any main campaign/editor files manually to my mod. Also, I have never used "Copy to my Mod.." option for any scripts. In a StoryEditor I see a long list of scripts (about 160) those are "grayed out" except the scripts I have created for my mod.

Joined: Jul 2014
R
addict
Offline
addict
R
Joined: Jul 2014
Noaloha, is your mod extending the Main campaign? The status effects are probably defined somewhere in one of those files.

If all else fails, you could use the CharacterConsume function to apply a status effect (simulates drinking a potion). You just need to use it as part of the AND checks instead of in the THEN, and you can try creating your own potion effect to use with it.

Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
Originally Posted by Rhidian
Noaloha, is your mod extending the Main campaign? The status effects are probably defined somewhere in one of those files.

It's entirely separate to the main campaign, with only Main selected as a Data Pack when it was first created. It's just a little ten minute puzzle right now really, but the goal is to turn it to into a more varied thirty minute adventure.

I may try your suggestion, but I just seem to be running into lots of (seemingly) entirely separate issues that aren't troubling anyone else and it's leading me to believe that I've critically messed up my mod's folder integrity somewhere. There's these status effects that aren't firing for me (seems like they should be), I can't get character dialog animations appearing where others can without issue, certain sound effects are missing sporadically, plus any number of other issues that I'm unaware of since I put a lot of 'not working' stuff down to my modding unfamiliarity and the DE being WIP.

If you recall, a week ago I posted I was having issues publishing my .pak; that issue turned out to be because I'd somehow inserted the entire main campaign into my folders, resulting in a 1.3GB mod .pak. I have no idea how I accomplished such a monumental screw up, ha. The fix was obviously to remove the 1.29GB of main campaign stuff, which I did after backing up the mod files and completely reinstalling both D:OS and the DE. I guess there's every chance that, in the process of going through the reinstall and main file deletion process, I took something out that I shouldn't have. Having said that, I've compared my folders with those of various .paks on the Workshop and everything seems present and correct at my end, so who knows.

I'm not too enamoured with the thought of persevering with a compromised mod though, the DE's already headache-inducing enough for a beginner like myself. Tomorrow I'm going to note down all my Escape From Smalcatraz mod issues and try to accomplish them in a complete new fresh mod, see if I can eliminate some possibilities. I'd rather fix the base problem than have to resort to faking an ApplyStatus command, if you know what I mean. I'll certainly keep that potion option in my back pocket though. :p


Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Aug 2014
R
apprentice
Offline
apprentice
R
Joined: Aug 2014
What he meant is, in your "story" do you have all the entries from the main game (__start and all that)

Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
Do you mean the content of my Story Editor _Start section?

This is the entirety of that section. Then all my coding stuff is set as children to it, or whatever that's called.
Code
Version 1
SubGoalCombiner SGC_AND
INITSECTION
CHARACTER_EFS_Detective_Scannon.isPlayer();
Proc_ResetCompanions();
Proc_ExclamationMarkCleanup();
KBSECTION
IF
GameEventSet("GAMEEVENT_GameStarted")
THEN
DB_InCharacterCreation(1);
InitStory();
GoalCompleted;
PROC
Proc_ExclamationMarkCleanup()
AND
_Player.IsPlayer()
THEN
CharacterStopAllEffectsWithName(_Player,"FX_GP_ExclamationMark_A");
CharacterSetHasDialog(_Player,0);
ItemToContainer(ITEM_EFS_LouNote1,ITEM_EFS_RingBinder,1);
ItemToContainer(ITEM_EFS_LouNote2,ITEM_EFS_RingBinder,1);
ItemToContainer(ITEM_EFS_LouNote3,ITEM_EFS_RingBinder,1);
ItemToContainer(ITEM_EFS_LouNote4,ITEM_EFS_RingBinder,1);
ItemToContainer(ITEM_EFS_LouNote5,ITEM_EFS_RingBinder,1);
ItemToContainer(ITEM_EFS_LouNote6,ITEM_EFS_RingBinder,1);

IF CharacterDied(CHARACTER_EFS_Detective_Scannon)
THEN
ShowGameOverMenu();
EXITSECTION

ENDEXITSECTION
TargetEdge "Cell"
TargetEdge "Chestroom"
TargetEdge "Gaolguard"
TargetEdge "Plumbing"
TargetEdge "Spider"
TargetEdge "testing"
TargetEdge "Traps"


I think when I was experimenting with my very very first mod, I copy pasted the main game's _Story+children into it, since it seemed to have important info. But there was no way I was going to include all those sections in my own mod once I started in earnest. Is there other content in the main campaign's _Story and children that is mandatory (or at least sensible) for all other mods that aren't just alterations to the main campaign?

Last edited by Noaloha; 15/08/14 07:31 PM.

Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Jul 2014
Location: Finland
journeyman
Offline
journeyman
Joined: Jul 2014
Location: Finland
I don't really know. I would presume that all files those are not under __Start are required for full functionality. Also, all files under __Start those do not begin with a level identifier such as CYS_ LUC_ HIB_ etc. are required.

I'll take a look into a few things and I report what I have found.




Joined: Aug 2014
R
apprentice
Offline
apprentice
R
Joined: Aug 2014
No, those aren't required. In fact, i uses nothing from the main game, and wrote my own _start. My _start is the only thing i had in story till i added my custom functions.

Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
Follow up on this issue.

If you take a look in Data\Mods\Main\Story\RawFiles\Goals\ you'll find a .txt file called 'Greevers_Little_helpers'. I'm not sure what to make of it to be honest, nor who this Greever individual might be. In any case, the .txt file is filled with lots of varied PROC->THEN calls, spanning all sorts of stuff.

For example, there is this part:

Code
//REGION Default Parameters
PROC
CharacterLookAtCharacter((CHARACTER)_Character1,(CHARACTER)_Character2)
THEN
CharacterLookAtCharacter(_Character1,_Character2,0);

PROC
CharacterPlayAnimation((CHARACTER)_Character,(STRING)_String)
THEN
CharacterPlayAnimation(_Character,_String,"");

PROC
CharacterTeleportToPosition((CHARACTER)_Character,(REAL)_X,(REAL)_Y,(REAL)_Z)
THEN
CharacterTeleportToPosition(_Character,_X,_Y,_Z,"");

PROC
CharacterTeleportToTrigger((CHARACTER)_Character,(TRIGGER)_Trigger)
THEN
CharacterTeleportToTrigger(_Character,_Trigger,"");

PROC
CharacterApplyStatus((CHARACTER)_Character,(STRING)_Status,(REAL)_Duration)
THEN
CharacterApplyStatus(_Character,_Status,_Duration,0);

PROC
ItemApplyStatus((ITEM)_Item,(STRING)_Status,(REAL)_Duration)
THEN
ItemApplyStatus(_Item,_Status,_Duration,0);

PROC
ItemToContainer((ITEM)_Item,(ITEM)_Container)
THEN
ItemToContainer(_Item,_Container,1);
//END_REGION


No idea why this stuff is required but, desperate and running out of fix attempts, I copy-pasted the following section into my own mod's goal (in which I'm attempting, and failing, to cause a status effect to apply):

Code
PROC
CharacterApplyStatus((CHARACTER)_Character,(STRING)_Status,(REAL)_Duration)
THEN
CharacterApplyStatus(_Character,_Status,_Duration,0);


And.. suddenly it works.


Is there something important I should be learning from this about how the StoryEditor works on a fundamental level? Why is the above code required to make the CharacterApplyStatus call work properly? What other stuff might this behaviour have an impact on?


Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Feb 2011
member
Offline
member
Joined: Feb 2011
Greever could be the nickname of a designer at Larian and the file seems to contain function prototypes.

Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
Yeah, Greever being a coder is my guess too.

It just puzzles me that, in my stand-alone mod, the following code in StoryEditor doesn't work:

Code
IF
CharacterItemEvent(_Player,ITEM_EFS_ChestLeverOut,"ChestDoorOut")
THEN
CharacterApplyStatus(_Player,"STUNNED",10.0);
CharacterPlayEffect(_Player,"FX_GP_Death_Lightning_A_Medium");


but this does:

Code
IF
CharacterItemEvent(_Player,ITEM_EFS_ChestLeverOut,"ChestDoorOut")
THEN
CharacterApplyStatus(_Player,"STUNNED",10.0);
CharacterPlayEffect(_Player,"FX_GP_Death_Lightning_A_Medium");

PROC
CharacterApplyStatus((CHARACTER)_Character,(STRING)_Status,(REAL)_Duration)
THEN
CharacterApplyStatus(_Character,_Status,_Duration,0);


It just seems odd to me that whatever the PROC>THEN piece of code is accomplishing isn't already integrated into the CharacterApplyStatus call itself, since surely that's what you expect CharacterApplyStatus to do. Further to that it makes me wary regarding what other calls require a second piece of code in order to simply work as expected.

Maybe I'm missing something extremely obvious?

In any case, I think I'm just going to copy that Greevers_Little_Help goal into my mod wholesale, ha.


Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Apr 2013
N
addict
Offline
addict
N
Joined: Apr 2013
I think that you can have multiple signatures for the CharacterApplyStatus name.
ie. you can have
CharacterApplyStatus((CHARACTER)Character,(STRING)Status,(REAL)Duration)
and
CharacterApplyStatus((CHARACTER)Character,(STRING)Status,(REAL)Duration,(INT)Force)
which are separate definitions.

When you assert CharacterApplyStatus(_Player,"STUNNED",10.0), you're actually using the first definiton, however the game engine itself only reacts to the second one.

Code
PROC
CharacterApplyStatus((CHARACTER)_Character,(STRING)_Status,(REAL)_Duration)
THEN
CharacterApplyStatus(_Character,_Status,_Duration,0);


This helper proc essentially bridges the 3-parameter and the 4-parameter definitions, ie. asserting the 3-parameter CharacterApplyStatus asserts the 4-parameter CharacterApplyStatus.

Joined: Jul 2014
Noaloha Offline OP
enthusiast
OP Offline
enthusiast
Joined: Jul 2014
Okay, that makes a lot of sense. I see it now. And I can see what the other pieces of code in that //REGION Default Parameters section of the .txt are accomplishing too looking at them that way. Thanks.

Of course, having said that, I don't think I've solved my problem. As I mentioned, the code works in a new, fresh module that I'm testing stuff in. I just transfered the code to Escape From Smalcatraz and nothing happens. Makes sense, because I seem to recall I tried both varieties of the CharacterApplyStatus call, with and without the 'force' part. I may just be missing something obvious or my mod might be screwed up. I'll check another time.


Escape From Smalcatraz: Steam/Nexus. Forum thread.
Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
Random note in case anyone else runs into this. I was monkeying around with this call before and couldn't find the knockdown effect. Couldn't find it for the life of me.

Figured there must be another file with a list and it looks like the best file for effects is StatusData.rb. In there I found it was KNOCKED_DOWN. The other effect strings are a lot more intuitive but this is one of only 3 with an underscore.

The file suggested earlier in the thread ValueList.xslm doesn't have the most accurate information.


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