Creating Plug-ins FAQ
[
Front page
] [
New
|
Page list
|
Search
|
Recent changes
|
Help
|
Log in
]
Start:
*Creating Plug-ins: FAQ [#yd254061]
This is a FAQ page about creating plug-ins using C#.
The content of this FAQ is based on the inquiries we have...
#Contents
----
**About Creating Plug-ins [#yf51f184]
***How do I create a plug-in? [#l88b35f3]
Please refer to the [[How to Use Plug-ins:https://rpgbaki...
***Can I choose which editor to launch when editing a C# ...
You can use a different editor by specifying an associati...
----
**Event Related [#n3fba2d3]
***Is there a method equivalent to the "Display Conversat...
"Conversation" can be achieved with the following method....
mapScene.ShowDialogue(msg, 0, MenuControllerBase.WindowT...
new AbstractRenderObject.GameContent.DialogueCharacterPr...
new AbstractRenderObject.GameContent.DialogueCharacterPr...
The DialogueCharacterProperty() parameter can be used to ...
#br
"Message" is the following method. As with conversation, ...
mapScene.ShowMessage(stringAttr.value, 0, MenuController...
#br
In addition, the "ticker" will be the following method.
mapScene.ShowTelop(msg, 0, MenuControllerBase.WindowTypes...
#br
ShowDialogue and ShowMessage return an ad hoc id in the r...
mapScene.IsQueuedDialogue(id)
and
mapScene.IsQueuedMessage(id)
to see if the displayed conversation or message is still ...
***Can I close a conversational message or dialog? [#gbf4...
This is not possible at the Ver. 1.9 stage.
***Which method corresponds to the "Display String as Ima...
You can use
Graphics.DrawString (with borders)
or
Graphics.DrawStringSoloColor (without borders).
At this time (ver. 1.9), we do not release methods for te...
(If you need formatted text decoration, please wait for t...
***Which method corresponds to the "Change Rendering Sett...
Please use the following:
var render = catalog.getItemFromName<Yukar.Common.Rom.Re...
mapScene.mapDrawer.setRenderSettings(render);
***Which methods correspond to the "Change Event Motion" ...
Please use one of the following two options.
mapChr.playMotion("MotionName")
mapScene.hero.playMotion(("MotionName", 0.2f, true, lock...
lockMotion = Whether to prevent disarming by walking, etc...
***Which method corresponds to "Apply Blend Shapes to Pla...
To assign a key and apply it, please use the following.
mapScene.hero.getModelInstance().setMorphBlend("KeyName"...
To assign a clip and apply it, please use the following.
The parameters are the target, the clip name, the interpo...
ScriptRunner.AddBlendShapeTask(mapScene.hero, "ClipName"...
***Is there a way to obtain the end of the motion? [#vd79...
Please use the sample code by binding it to an event.
[[MotionUtil.cs:https://rpgbakin.com/pukiwiki_en/?plugin=...
GetMotionLoopCount to obtain the number of motion loops.
In the case of a one-shot, the motion can be considered c...
PlayMotionImmediately starts motion playback without blen...
Use this when the normal motion playback panel is too muc...
***Is there a way to obtain "Execute Common Event" using ...
It can be obtained in the following way:
// Find the common event by name (if you know the GUID, ...
var guid = catalog.getGameSettings().commonEvents.FirstO...
if(guid != Guid.Empty)
{
// Obtain runner from map scene
var runner = mapScene.GetScriptRunner(guid);
// If a runner could not be obtained (not a single s...
if (runner == null)
return;
// Start execution
bool result = runner.Run();
// If you want to run it during a battle, flag it to...
var btlEvtCtl = mapScene as BattleEventControllerBase;
if (result && btlEvtCtl != null)
{
btlEvtCtl.start(guid);
}
}
***Is there a way to stop and resume without proceeding t...
By passing Func<bool> to SetWaiter as shown below, the ev...
[BakinFunction]
public void WaitFunc()
{
float elapsed = 0;
runner.SetWaiter(() => {
elapsed += GameMain.getElapsedTime();
return elapsed < 10; // Stop the progress...
});
}
***Can I display a speech bubble at the player or cast po...
Please call the following for each frame.
mapScene.GetCharacterScreenPos(MapCharacter, out var x, ...
mapScene.menuWindow.AdjustBalloonRect(x, y - 32);
***What font and color should I assign to Yukar.Engine.Te...
color should be assigned the Microsoft.Xna.Framework.Colo...
As for font, if you do not need to specify the size, assi...
Graphics.DrawString(0, "String_to_be_Displayed", new Vec...
If you need to assign a size, please create an instance o...
Note that the created instance of the SharpKmyGfx class m...
***Is there an equivalent to the event panels "Display Im...
The following will be the way:
// Display image
int spIndex = 0; // Image Number
int sliceNo = 0; // If the image has a slice assigned to...
var guid = catalog.getItemFromName<Yukar.Common.Resource...
mapScene.spManager.ShowPicture(spIndex, guid, 100, 100, ...
// Set the coordinates
int x = 0; // Coordinate X
int y = 0; // Coordinate Y
mapScene.spManager.Move(spIndex, 0, x, y);
// Display string as an image
int spIndex = 0; // Image Number
int x = 0; // Coordinate X
int y = 0; // Coordinate Y
mapScene.spManager.ShowText(spIndex, "String_to_be_Displ...
***Is there a way that corresponds to the event panels "E...
Each of them is as follows:
-"Enable/Disable Player Operation"
--Enable
mapScene.playerLocked &= ~MapScene.PLAYER_LOCK_BY_EVE...
--Disable
mapScene.playerLocked |= MapScene.PLAYER_LOCK_BY_EVENT;
#br
- "Enable/Disable Player Orientation Change"
--Disable
mapScene.owner.data.start.fixDirectionPlayer = true;
mapScene.hero.dirMethod = MapCharacter.DirectionMetho...
--Enable
mapScene.owner.data.start.fixDirectionPlayer = false;
mapScene.hero.dirMethod = MapCharacter.DirectionMethod...
#br
- "Enable/Disable Player to Run"
--Enable
mapScene.owner.data.system.dashAvailable = true;
--Disable
mapScene.owner.data.system.dashAvailable = false;
#br
- "Enable/Disable Jump"
--Enable
mapScene.owner.data.system.jumpAvailable = true;
--Disable
mapScene.owner.data.system.jumpAvailable = false;
#br
- "Enable/Disable Move"
--Enable
mapScene.owner.data.system.walkAvailable = true;
--Disable
mapScene.owner.data.system.walkAvailable = true;
***Is there a way to correspond to the event panels "Star...
It is not disclosed as a function.
For those with rigid bodies, the physics is handled by sp...
(tgt is an instance of the MapCharacter class)
var rgd = tgt.getRigidbody();
tgt.setGravity(speed);
tgt.fixHeight = false;
tgt.refreshRigidBodyMask();
rgd.activate(true);
rgd.setAngularDamping(0.5f);
rgd.setPositionDamping(0.5f);
For those without a rigid body, please move the Y positio...
***Is there a way to correspond to the event panel "Wait ...
Please measure the time using the following:
[BakinFunction]
public void WaitFunc()
{
float elapsed = 0;
runner.SetWaiter(() => {
elapsed += GameMain.getElapsedTime();
return elapsed < 10; // Stop the progress...
});
}
***Which method corresponds to the display position > "Di...
MapScene.GetCharacterScreenPos() is used for both panels ...
***What code corresponds to the "Add and Display" feature...
The currently displayed free layouts are stored in GameMa...
If you want to display something new that is not already ...
// When open
var lyt = catalog.getLayoutProperties().AllLayoutNodes.F...
if (lyt != null)
{
GameMain.instance.ShowFreeLayout(lyt.Guid);
}
***Is there a method for Collision Detection on event con...
There is no method that explicitly determines the Collisi...
For collision detection at the time of contact, use mapCh...
***Is there a code to turn on/off the collision settings ...
The following is the code:
mapChr.collisionStatus.playerCollidable = true; // Colli...
mapChr.collisionStatus.eventCollidable = true; // Collid...
mapChr.fixPos = true; // Move When Push
The following call is required for the above specified ch...
mapChr.refreshRigidBodyMask(); // If only collidable is ...
mapChr.refreshRigidBody(); // If fixPos is also changed
***What does "MAP_SLOPE", which can be selected in Collis...
MAP_SLOPE targets slopes and stairs.
This is done with "Check Surrounding Collision Detection ...
(CollisionType.MAP and CollisionType.MAP_SLOPE are target...
However, it is not applicable in cases where the height o...
Try adjusting the height of the raycast.
***Is there a way to use the raycast function to detect t...
You can do this in the following way:
var result = chr.getRigidbody().getPhysicsBase().rayCast(
Util.ToKmyVector(thisCastPos), // from
Util.ToKmyVector(playerPos), // to
(ushort)(CollisionType.PLAYER) , hit);
***Is there a way to enhance Enhancement Item with a plug...
Please use AdvancedEnhance().
Please refer to the script below for instructions on how ...
[[ItemEnhancementSampleScript_1.cs:https://rpgbakin.com/p...
***Is there a way to execute an item obtaining event when...
The following steps can be taken to obtain enhanced items...
[BakinFunction]
public void AddEnhancedItem()
{
var item = catalog.getItemFromName<Yukar.Com...
var enhancedItem = item.CreateEnhancedItem();
catalog.addEnhancedItem(enhancedItem);
GameMain.instance.data.party.SetItemNum(enha...
var ev = catalog.getItemFromGuid(item.script...
var runner = mapScene.mapEngine.AddEvent(map...
}
***If there are multiple names of the same item, is it po...
This can be done by using the following:
var item = catalog.getItemFromName<Yukar.Common.Rom.NIte...
var enhancedItemList = GameMain.instance.data...
***Can I generate cast events that are not placed on a ma...
It is possible if you can find the cast from catalog and ...
Basically, you can find what you are defining in the Data...
GameMain.instance.pushTask(() =>
{
var cast = catalog.getItemFromName<Yukar....
targetEvent.CreateEvent(cast.eventRef,
targetEvent.getDirectionRadian());
return false;
});
***Is there a code to obtain and specify the current valu...
Please use the following:
// Map events are currently controlled from the system ...
mapChr.battleStatus.HitPoint;
// Not accessed by the map battle system, but...
mapChr.battleStatus.battleStatusData.consumpt...
// For obtaining other normal statuses
mapChr.battleStatus.battleStatusData.statusVa...
***What are the parameters of Yukar.Engine.MapCharacter.p...
name is the motion name and blendTime is the motion's ble...
Assigning false by isTemporary will change the name of th...
This motion name is used to determine the behavior if the...
The doMotionLock is a flag that prevents motion changes c...
After the = in the parameter portion of the definition (e...
void Yukar.Engine.MapCharacter.playMotion(
string name,
float blendTime = 0.2f,
bool isTemporary = false,
bool doLockMotion = false
)
***Is there a way to obtain if an event is "Talkable Stat...
Please refer to the following script to obtain from the c...
[[Talkable.txt:https://rpgbakin.com/pukiwiki_en/?plugin=a...
To obtain from a normal event, change the method as follo...
[BakinFunction(Description = "The player can talk to thi...
public int GetTalkableForThis()
{
// Obtain the currently selected sheet
var scriptGuid = mapChr.getCurrentSheet()?.sc...
var script = catalog.getItemFromGuid(scriptGu...
// No sheet with conditions satisfied
if (script == null)
return 0;
// Even if it's a talkable event, if it's emp...
if (script.commands.Count == 0)
return 0;
// If it is in a talkable position, return 1.
if (mapScene.hero.collisionStatus.talkableChr...
return 1;
return 0;
}
***Is it possible to pause and play the animation during ...
This is not possible at this time (Ver. 1.10).
----
**Resources [#pc6e0230]
***Can I toggle stamp subgraphics on and off? [#yaae21e7]
Please use the following.
mapChr.SetSubGraphicOpacity
***Can I toggle stamp subgraphic "Apply Position Only" on...
Subgraphic positions are interpreted in mapChr.DisplayObj...
It can be obtained using the following.
((Yukar.Common.Resource.GfxResourceBase)mapChr.getGrap...
#br
''Changes are not recommended, as they will directly rewr...
***Can I specify the relative position XYZ, relative angl...
The following pos, rot, and scale manage these information.
((Yukar.Common.Resource.GfxResourceBase)mapChr.getGraphi...
#br
''Changes are not recommended, as they will directly rewr...
***Is it possible to toggle on/off the "Use" of the local...
The following useLight manages the on/off information.
((Yukar.Common.Resource.GfxResourceBase)mapChr.getGraphi...
#br
''Changes are not recommended, as they will directly rewr...
***Can I assign a motion for a slice animation and then r...
This can be done by the following way.
var spIndex = 10; // Sprite Number
var guid = new Guid("c15f94b6-d4a0-46c4-bc43-...
var zoom = 100;
var x = 640;
var y = 360;
mapScene.spManager.ShowPicture(spIndex, guid,...
Microsoft.Xna.Framework.Color.White, new ...
The GUID of the slice animation can be obtained by right-...
Unlike Graphics.drawImage, this can be executed only once...
It can be moved with "mapScene.spManager.Move" and remove...
This is the class used in the "Display Image" event panel.
***Is there a code that specifies the color, intensity, a...
The following procedure can be used to set up the settings.
var index = 1; // Target subgraphic number
foreach (var obj in mapChr.DisplayObjects)
{
if(obj.index == index && obj.instance is ...
{
lgt.setIntensity(Intensity);
lgt.setColor(Color);
lgt.setRadius(Radius);
}
}
#br
''Changes are not recommended, as they will directly rewr...
----
**Map Related [#jcf81255]
***Is there a method, like in the Map Editor, for an obje...
This feature is not available in the engine because it us...
***Is there any way to obtain the coordinates specified i...
Please use the following.
mapScene.map.mapCameraRange
if(mapScene.map.mapCameraRange == Rectangle.Empty) is tru...
***Can I change the "Skybox Model" and "Environment Map" ...
Set the model GUID in
mapScene.mapDrawer.renderSettings.skyModel
and then after setting the environment map texture GUID in
mapScene.mapDrawer.renderSettings.reflection
execute
mapScene.mapDrawer.setRenderSettings(mapScene.mapDrawer.r...
***Is there a code to specify the color, intensity and ra...
You can change it with the following code.
var lgt = mapScene.mapDrawer.mapRom.localLights.FirstOrDe...
lgt.setIntensity(Intensity);
lgt.setColor(Color);
lgt.setRadius(Radius);
***Is there code to obtain and specify values for "lights...
It can be obtained from mapScene.mapDrawer.renderSettings.
Regarding the settings, some options are reflected by cha...
To change the elements that require loading of resources ...
----
**Map Battle [#v56750a1]
***Is there a code to change the Category (ally, enemy, b...
The following code can be used to obtain the cast type of...
var type = mapChr.rom?.CastType ?? Yukar.Common.Rom.Cast...
Refer [[Collision Detection between Cast Members and Even...
***Is it possible to change the color and size of the dam...
It is possible with the following code.
var viewer = mapScene.fieldBattleViewer;
viewer.zoomedScale = 2.0f; // Scale at just t...
viewer.damageScale = 1.0f; // Eventual scale
viewer.zoomTime = 0.1f; // Time to reach even...
viewer.drawTime = 1.0f; // Time until damage ...
viewer.damageColor = Microsoft.Xna.Framework....
viewer.criticalDamageColor = Microsoft.Xna.Fr...
viewer.criticalDamageColor = Microsoft.Xna.Fr...
You can also create your own damage rendering process usi...
[[ChangeFieldBattleViewer.cs:https://rpgbakin.com/pukiwik...
***Is there a way to generate critical damage during map ...
Since the judgment is made randomly based on the critical...
It would be a good idea to use state changes to temporari...
***Is it possible to specify how long it takes for a dama...
You can still obtain the information by using the followi...
mapChr.rom.InvincibleTime
''However, the change is not recommended because it would...
***Is there a code to change the color of damaged casts (...
There is a definition in MapCharacter.invalidDamageColor.
----
**Game Definition [#ka7379f4]
***Is it possible to obtain/change the ON/OFF of "Basic O...
You can switch using the following.
GameMain.instance.data.start.controlMode = Yukar.Common....
GameMain.instance.data.start.controlMode = Yukar.Common....
***Can I obtain/change the "Talking Detection Scale" in R...
The scale itself can be obtained with GameMain.instance.c...
''However, changes are not recommended since they directl...
''It is not recommended to change the values for GameSett...
***Is it possible to obtain/change the ON/OFF of "Disable...
It can be obtained and changed using the following.
mapScene.mapFixCamera
In addition, individual enable/disable for each camera op...
owner.data.start.camLockX
owner.data.start.camLockY
owner.data.start.camLockZoom
owner.data.start.camLockReset
***Is it possible to turn on/off "Terrains" and "Objects"...
You can use the following to obtain the states of each.
catalog.getGameSettings().CameraAvoidObjects
catalog.getGameSettings().CameraAvoidTerrain
''However, changes are not recommended since they directl...
***Is it possible to obtain/change the ON/OFF of "Get Beh...
It is possible to obtain information using the following.
GameMain.instance.catalog.getGameSettings().isTpsMode
''However, changes are not recommended since they directl...
***Is it possible to change the coefficients for movement...
Not possible. Please use the Game Definition settings as ...
***Can I change the "Standard Turning Speed" in Rules & O...
It is possible to obtain the speed using the following.
GameMain.instance.catalog.getGameSettings().DefaultRotat...
''However, changes are not recommended since they directl...
***Is it possible to change the "Sensitivity" of "Mouse U...
Cannot be done.
Instead, create your own process to rotate the camera acc...
***How do I display the version, creator, etc. of a proje...
It is possible to obtain information using the following.
catalog.getGameSettings().meta.buildVer
The information can then be displayed on the layout by st...
GameMain.instance.data.system.SetVariable("VariableName"...
However, running C# on the default title screen is not po...
Therefore, the title screen should be skipped in the Game...
***Is it possible to obtain the ON/OFF judgement for "Aut...
A sample code is attached.
[[ConfigGetter.cs:https://rpgbakin.com/pukiwiki_en/?plugi...
It can be obtained by executing the C# method "GetAutoDas...
----
***Is there any way to specify the friction between the "...
Please use the following.
MapCharacter.getRigidBody().setFriction(FrictionValue)
However, since MapCharacter controls friction accordingly...
***Can I change the transparency of the player and cast? ...
The following method can be used.
mapChr.setOpacityMultiplier(0.5f); // Fully transparent ...
***I have tried mapScene.hero.setOpacityMultiplier(Value)...
Regarding setOpacityMultiplier, the player is constantly ...
Try setting every frame with AfterDraw().
***Is there a code to open/close a free layout with a spe...
Please use the code below.
// To open
var lyt = catalog.getLayoutProperties().AllLayoutNodes.F...
if (lyt != null)
{
GameMain.instance.ShowFreeLayout(lyt.Guid);
}
// To close
var lyt = GameMain.instance.freeLayouts.FirstOrDefault(x...
if (lyt != null)
{
GameMain.instance.HideFreeLayout(lyt.LayoutGuid);
}
***Is there any way to change "Movement Axis is Horizonta...
Each of them is as follows:
-"Movement Axis is Horizontal and Depth"
mapScene.owner.catalog.getGameSettings().axisMode = Yuka...
-"Movement Axis is Horizontal and Elevation"
mapScene.owner.catalog.getGameSettings().axisMode = Yuka...
***Can I change the Maximum Capacity of the Inventory und...
To change the Maximum Capacity of the Inventory while the...
This value is saved in the saved data, not in the Game De...
***Is it possible to specify or change the sound effects ...
SEs can be changed by following the steps below.
var sound = catalog.getItemFromName<Yukar.Common.Resourc...
Audio.UnloadSound(GameMain.instance.se.decide);
GameMain.instance.se.decide = Audio.LoadSound(sound);
However, these are not eligible for saving to saved data ...
----
**Layout [#k0ab1c79]
***Is it possible to specify the display position of a fr...
You can do so as shown below, but since the assignment to...
var lyt = GameMain.instance.freeLayouts.FirstOrDefault(x...
if (lyt != null)
{
var node = lyt.LayoutDrawer.ParseNodes().FirstOrDefa...
node.Position = new Microsoft.Xna.Framework.Vector2(...
node.MenuItem.positionAnchorTag = "Rewrite Special C...
}
***Can I obtain the container management number (index) o...
You can access the currently displayed layout by the foll...
[BakinFunction(Description = "Obtain the containe...
public int GetIndex()
{
// First, obtain the main menu manager
var lc = mapScene.menuWindow as LayoutMenuCon...
var lm = lc.mainMenu;
// Track and obtain open layouts derived from...
// (If it's being called from item select, it...
while (lm.NextlayoutManager != null)
lm = lm.NextlayoutManager;
// Obtain the currently selected index from t...
var drawer = lm.LayoutDrawer;
GameMain.PushLog(DebugDialog.LogEntry.LogType...
return drawer.GetSelectIndex();
}
Furthermore, if you wish to force the main menu to close ...
[BakinFunction]
public void CloseMainMenu()
{
// First, obtain the main menu manager
var lc = mapScene.menuWindow as LayoutMenuCon...
var lm = lc.mainMenu;
lm.HideAll();
}
Incidentally, to obtain the currently selected index from...
[BakinFunction]
public int GetIndexForFreeLayout()
{
// First, obtain a free layout manager
var lm = GameMain.instance.freeLayouts.FirstO...
if (lm == null)
{
GameMain.PushLog(DebugDialog.LogEntry.Log...
return -1;
}
// Obtain the currently selected index from t...
var drawer = lm.LayoutDrawer;
GameMain.PushLog(DebugDialog.LogEntry.LogType...
return drawer.GetSelectIndex();
}
***I was determining if a Free Layout for Event was displ...
To look at GameMain.instance.freeLayouts.Count, please us...
// Hide all
GameMain.instance.HideALLFreeLayout(mapScene.isBattle);
// Show only selected layouts
GameMain.instance.ShowFreeLayout(layoutGuid, mapScene.is...
// Add and display selected layouts
GameMain.instance.AddFreeLayout(layoutGuid, mapScene.isB...
// Hide selected layouts
GameMain.instance.HideFreeLayout(layoutGuid, mapScene.is...
***Is there a code (code to control the visibility of eac...
Plug-in Reference: Use the Show/Hide methods in the Yukar...
If animation is not required, ShowWithNotAnimation/HideWi...
Search for "RenderContainer" in the Plug-in Reference to ...
https://rpgbakin.com/csreference/doc/ja/class_yukar_1_1_e...
***Can I use a plug-in to prevent the layout from closing...
The following method is available to prohibit cancellation.
Please try writing it in Update().
var menu = mapScene.menuWindow as LayoutMenuController;
var lyt = menu.mainMenu;
while (lyt.NextlayoutManager != null)
lyt = lyt.NextlayoutManager;
if (lyt.LayoutNode.Name == "SkillSelect") // In the S...
{
// Basically, it should be unlocked.
if (lyt.IsLocked())
lyt.UnLock();
// Cancellation Prohibited
if (Input.KeyTest(Input.StateType.TRIGGER, Input....
lyt.Lock();
}
***How do I control the display position of Free Layout f...
First, you must also specify a value for defaultPosition ...
(Also needs to access defaultPosition, so cast is also ne...
var node = lyt.LayoutDrawer.ParseNodes().FirstOrDefault...
node.Position = node.defaultPosition = node.MenuItem.po...
When the sprite used for the animation switches, it gets ...
Currently, the position is specified by SetLayoutPosition...
----
**Database [#xb53bdd7]
***Is it possible to retrieve the Management Tags + Notes...
This is the case for the field named tags.
You can access it by the following.
catalog.getItemFromName<Yukar.Common.Rom.Cast>("Hero").t...
***Is it possible to obtain a list of the skills that the...
The skills that a cast member learns are in Cast.availabl...
var learnSkills = catalog.getItemFromName<Yukar.Common.R...
Skills are stored in the form of GUIDs, so Achievement Le...
if (learnSkills.Count > 0)
{
var skill = catalog.getItemFromGuid(learnSkills[0].s...
GameMain.PushLog(DebugDialog.LogEntry.LogType.EVENT,...
}
A complete list of all skills can be obtained by the foll...
var allSkills = catalog.getFilteredItemList<Y...
***Is it possible to obtain Money in Possession or droppe...
You can obtain the EXP of the first monster by the follow...
BattleSequenceManagerBase.Get().EnemyViewDataList[0].mon...
You can also obtain the first drop item of the first mons...
var guid = BattleSequenceManagerBase.Get().EnemyViewData...
var name = catalog.getItemFromGuid(guid)?.name;
When actually using the EnemyViewDataList or dropItems, c...
**Sound [#heed049c]
***Is there a code to play sound effects? [#p8b95615]
Please obtain rom from catalog as follows.
var rom = catalog.getItemFromGuid(guid) as Yukar.Common....
Audio.LoadSound(rom);
----
**Others [#lc600476]
***Can the background music be crossfaded? [#af79a21f]
BGM as a system has only one playback line, so it cannot ...
First, use the following method to start playback with ze...
var id = Audio.LoadSound(guid);
Audio.PlaySound(id, 0, 0, 1);
Then use the following to manipulate the volume every fra...
Audio.SetSEVolume(id, volume);
***Can I switch the battle camera during a battle? [#i83a...
You can change it with the following code.
GameMain.instance.data.system.currentBattleCa...
The camera will be reflected at the time of camera switch...
mapScene.applyCameraToBattle();
Please note, however, that this is only effective from th...
***If I want to display a specific image, how should I wr...
First load the texture using the following code in Start(...
tex = catalog.getItemFromName<Yukar.Common.Re...
Graphics.LoadImage(tex);
Then, use the following at the scene you wish to render (...
Graphics.DrawImage(tex, x, y);
After use, release the image used when the event is disca...
public override void Destroy()
{
Graphics.UnloadImage(tex);
}
***Is it possible to use the event generation mapChr.Crea...
It is available for use.
It can be used like mapChr.CreateEvent(guid, dir);.
mapChr.getDirectionRad() should be passed for dir if you ...
guid is the GUID of the cast.
It would be better to use catalog.getItemFromName("name o...
Once a GUID is created for a cast, it does not change. Th...
***What value does the getRelativeParam60FPS function in ...
getRelativeParam60FPS is the elapsed time from the previo...
In other words, this method returns the time taken for on...
#br
Within the C# script Update(), frameCount++; will add 1 t...
However, this method will result in the addition of non-"...
Therefore, instead of frameCount++, frameCount += getRela...
***Util.UnProject2World() is used to find the coordinates...
Util.UnProject2World() is a method that converts XY coord...
Pass the projection and view matrices of the current came...
Basically, assign mapScene.CurrentPP, mapScene.CurrentVV.
***When TOUCH is assigned to KeyState in Input.KeyTest(),...
Input.KeyTest() is a method that obtains the state of the...
The purpose is to simulate touch behavior, so it is proce...
If you want unprocessed values, assign SYSTEM instead of ...
***Is there a way to change the player's position during ...
Since using setPositiion will reset velocity, instead, ta...
***Is it possible to change the value of the camera tool ...
If the change is made from a C# script, it will be as fol...
Camera
mapScene.CameraManager.ntpCamera
Key Frame
getKeyFrame()
DOF
Yukar.Common.Rom.Camera.KeyFrame.dof
X=Focal Coefficient, Y=Focal Range Coefficient, Z=Blu...
Please note that changing the value using a C# script wil...
***How do I obtain the save data storage slot number (0-)...
The save slot number is obtained in var index.
[BakinFunction(Description = "Description")]
public void Func()
{
var lc = mapScene.GetMenuController();
var lm = lc.mainMenu;
var index = lm.SelectProp.SelectSaveIndex;
}
var lm = lc.mainMenu will be if saved from the Main Menu.
If it was saved from an event with "Display Save Screen",...
End:
*Creating Plug-ins: FAQ [#yd254061]
This is a FAQ page about creating plug-ins using C#.
The content of this FAQ is based on the inquiries we have...
#Contents
----
**About Creating Plug-ins [#yf51f184]
***How do I create a plug-in? [#l88b35f3]
Please refer to the [[How to Use Plug-ins:https://rpgbaki...
***Can I choose which editor to launch when editing a C# ...
You can use a different editor by specifying an associati...
----
**Event Related [#n3fba2d3]
***Is there a method equivalent to the "Display Conversat...
"Conversation" can be achieved with the following method....
mapScene.ShowDialogue(msg, 0, MenuControllerBase.WindowT...
new AbstractRenderObject.GameContent.DialogueCharacterPr...
new AbstractRenderObject.GameContent.DialogueCharacterPr...
The DialogueCharacterProperty() parameter can be used to ...
#br
"Message" is the following method. As with conversation, ...
mapScene.ShowMessage(stringAttr.value, 0, MenuController...
#br
In addition, the "ticker" will be the following method.
mapScene.ShowTelop(msg, 0, MenuControllerBase.WindowTypes...
#br
ShowDialogue and ShowMessage return an ad hoc id in the r...
mapScene.IsQueuedDialogue(id)
and
mapScene.IsQueuedMessage(id)
to see if the displayed conversation or message is still ...
***Can I close a conversational message or dialog? [#gbf4...
This is not possible at the Ver. 1.9 stage.
***Which method corresponds to the "Display String as Ima...
You can use
Graphics.DrawString (with borders)
or
Graphics.DrawStringSoloColor (without borders).
At this time (ver. 1.9), we do not release methods for te...
(If you need formatted text decoration, please wait for t...
***Which method corresponds to the "Change Rendering Sett...
Please use the following:
var render = catalog.getItemFromName<Yukar.Common.Rom.Re...
mapScene.mapDrawer.setRenderSettings(render);
***Which methods correspond to the "Change Event Motion" ...
Please use one of the following two options.
mapChr.playMotion("MotionName")
mapScene.hero.playMotion(("MotionName", 0.2f, true, lock...
lockMotion = Whether to prevent disarming by walking, etc...
***Which method corresponds to "Apply Blend Shapes to Pla...
To assign a key and apply it, please use the following.
mapScene.hero.getModelInstance().setMorphBlend("KeyName"...
To assign a clip and apply it, please use the following.
The parameters are the target, the clip name, the interpo...
ScriptRunner.AddBlendShapeTask(mapScene.hero, "ClipName"...
***Is there a way to obtain the end of the motion? [#vd79...
Please use the sample code by binding it to an event.
[[MotionUtil.cs:https://rpgbakin.com/pukiwiki_en/?plugin=...
GetMotionLoopCount to obtain the number of motion loops.
In the case of a one-shot, the motion can be considered c...
PlayMotionImmediately starts motion playback without blen...
Use this when the normal motion playback panel is too muc...
***Is there a way to obtain "Execute Common Event" using ...
It can be obtained in the following way:
// Find the common event by name (if you know the GUID, ...
var guid = catalog.getGameSettings().commonEvents.FirstO...
if(guid != Guid.Empty)
{
// Obtain runner from map scene
var runner = mapScene.GetScriptRunner(guid);
// If a runner could not be obtained (not a single s...
if (runner == null)
return;
// Start execution
bool result = runner.Run();
// If you want to run it during a battle, flag it to...
var btlEvtCtl = mapScene as BattleEventControllerBase;
if (result && btlEvtCtl != null)
{
btlEvtCtl.start(guid);
}
}
***Is there a way to stop and resume without proceeding t...
By passing Func<bool> to SetWaiter as shown below, the ev...
[BakinFunction]
public void WaitFunc()
{
float elapsed = 0;
runner.SetWaiter(() => {
elapsed += GameMain.getElapsedTime();
return elapsed < 10; // Stop the progress...
});
}
***Can I display a speech bubble at the player or cast po...
Please call the following for each frame.
mapScene.GetCharacterScreenPos(MapCharacter, out var x, ...
mapScene.menuWindow.AdjustBalloonRect(x, y - 32);
***What font and color should I assign to Yukar.Engine.Te...
color should be assigned the Microsoft.Xna.Framework.Colo...
As for font, if you do not need to specify the size, assi...
Graphics.DrawString(0, "String_to_be_Displayed", new Vec...
If you need to assign a size, please create an instance o...
Note that the created instance of the SharpKmyGfx class m...
***Is there an equivalent to the event panels "Display Im...
The following will be the way:
// Display image
int spIndex = 0; // Image Number
int sliceNo = 0; // If the image has a slice assigned to...
var guid = catalog.getItemFromName<Yukar.Common.Resource...
mapScene.spManager.ShowPicture(spIndex, guid, 100, 100, ...
// Set the coordinates
int x = 0; // Coordinate X
int y = 0; // Coordinate Y
mapScene.spManager.Move(spIndex, 0, x, y);
// Display string as an image
int spIndex = 0; // Image Number
int x = 0; // Coordinate X
int y = 0; // Coordinate Y
mapScene.spManager.ShowText(spIndex, "String_to_be_Displ...
***Is there a way that corresponds to the event panels "E...
Each of them is as follows:
-"Enable/Disable Player Operation"
--Enable
mapScene.playerLocked &= ~MapScene.PLAYER_LOCK_BY_EVE...
--Disable
mapScene.playerLocked |= MapScene.PLAYER_LOCK_BY_EVENT;
#br
- "Enable/Disable Player Orientation Change"
--Disable
mapScene.owner.data.start.fixDirectionPlayer = true;
mapScene.hero.dirMethod = MapCharacter.DirectionMetho...
--Enable
mapScene.owner.data.start.fixDirectionPlayer = false;
mapScene.hero.dirMethod = MapCharacter.DirectionMethod...
#br
- "Enable/Disable Player to Run"
--Enable
mapScene.owner.data.system.dashAvailable = true;
--Disable
mapScene.owner.data.system.dashAvailable = false;
#br
- "Enable/Disable Jump"
--Enable
mapScene.owner.data.system.jumpAvailable = true;
--Disable
mapScene.owner.data.system.jumpAvailable = false;
#br
- "Enable/Disable Move"
--Enable
mapScene.owner.data.system.walkAvailable = true;
--Disable
mapScene.owner.data.system.walkAvailable = true;
***Is there a way to correspond to the event panels "Star...
It is not disclosed as a function.
For those with rigid bodies, the physics is handled by sp...
(tgt is an instance of the MapCharacter class)
var rgd = tgt.getRigidbody();
tgt.setGravity(speed);
tgt.fixHeight = false;
tgt.refreshRigidBodyMask();
rgd.activate(true);
rgd.setAngularDamping(0.5f);
rgd.setPositionDamping(0.5f);
For those without a rigid body, please move the Y positio...
***Is there a way to correspond to the event panel "Wait ...
Please measure the time using the following:
[BakinFunction]
public void WaitFunc()
{
float elapsed = 0;
runner.SetWaiter(() => {
elapsed += GameMain.getElapsedTime();
return elapsed < 10; // Stop the progress...
});
}
***Which method corresponds to the display position > "Di...
MapScene.GetCharacterScreenPos() is used for both panels ...
***What code corresponds to the "Add and Display" feature...
The currently displayed free layouts are stored in GameMa...
If you want to display something new that is not already ...
// When open
var lyt = catalog.getLayoutProperties().AllLayoutNodes.F...
if (lyt != null)
{
GameMain.instance.ShowFreeLayout(lyt.Guid);
}
***Is there a method for Collision Detection on event con...
There is no method that explicitly determines the Collisi...
For collision detection at the time of contact, use mapCh...
***Is there a code to turn on/off the collision settings ...
The following is the code:
mapChr.collisionStatus.playerCollidable = true; // Colli...
mapChr.collisionStatus.eventCollidable = true; // Collid...
mapChr.fixPos = true; // Move When Push
The following call is required for the above specified ch...
mapChr.refreshRigidBodyMask(); // If only collidable is ...
mapChr.refreshRigidBody(); // If fixPos is also changed
***What does "MAP_SLOPE", which can be selected in Collis...
MAP_SLOPE targets slopes and stairs.
This is done with "Check Surrounding Collision Detection ...
(CollisionType.MAP and CollisionType.MAP_SLOPE are target...
However, it is not applicable in cases where the height o...
Try adjusting the height of the raycast.
***Is there a way to use the raycast function to detect t...
You can do this in the following way:
var result = chr.getRigidbody().getPhysicsBase().rayCast(
Util.ToKmyVector(thisCastPos), // from
Util.ToKmyVector(playerPos), // to
(ushort)(CollisionType.PLAYER) , hit);
***Is there a way to enhance Enhancement Item with a plug...
Please use AdvancedEnhance().
Please refer to the script below for instructions on how ...
[[ItemEnhancementSampleScript_1.cs:https://rpgbakin.com/p...
***Is there a way to execute an item obtaining event when...
The following steps can be taken to obtain enhanced items...
[BakinFunction]
public void AddEnhancedItem()
{
var item = catalog.getItemFromName<Yukar.Com...
var enhancedItem = item.CreateEnhancedItem();
catalog.addEnhancedItem(enhancedItem);
GameMain.instance.data.party.SetItemNum(enha...
var ev = catalog.getItemFromGuid(item.script...
var runner = mapScene.mapEngine.AddEvent(map...
}
***If there are multiple names of the same item, is it po...
This can be done by using the following:
var item = catalog.getItemFromName<Yukar.Common.Rom.NIte...
var enhancedItemList = GameMain.instance.data...
***Can I generate cast events that are not placed on a ma...
It is possible if you can find the cast from catalog and ...
Basically, you can find what you are defining in the Data...
GameMain.instance.pushTask(() =>
{
var cast = catalog.getItemFromName<Yukar....
targetEvent.CreateEvent(cast.eventRef,
targetEvent.getDirectionRadian());
return false;
});
***Is there a code to obtain and specify the current valu...
Please use the following:
// Map events are currently controlled from the system ...
mapChr.battleStatus.HitPoint;
// Not accessed by the map battle system, but...
mapChr.battleStatus.battleStatusData.consumpt...
// For obtaining other normal statuses
mapChr.battleStatus.battleStatusData.statusVa...
***What are the parameters of Yukar.Engine.MapCharacter.p...
name is the motion name and blendTime is the motion's ble...
Assigning false by isTemporary will change the name of th...
This motion name is used to determine the behavior if the...
The doMotionLock is a flag that prevents motion changes c...
After the = in the parameter portion of the definition (e...
void Yukar.Engine.MapCharacter.playMotion(
string name,
float blendTime = 0.2f,
bool isTemporary = false,
bool doLockMotion = false
)
***Is there a way to obtain if an event is "Talkable Stat...
Please refer to the following script to obtain from the c...
[[Talkable.txt:https://rpgbakin.com/pukiwiki_en/?plugin=a...
To obtain from a normal event, change the method as follo...
[BakinFunction(Description = "The player can talk to thi...
public int GetTalkableForThis()
{
// Obtain the currently selected sheet
var scriptGuid = mapChr.getCurrentSheet()?.sc...
var script = catalog.getItemFromGuid(scriptGu...
// No sheet with conditions satisfied
if (script == null)
return 0;
// Even if it's a talkable event, if it's emp...
if (script.commands.Count == 0)
return 0;
// If it is in a talkable position, return 1.
if (mapScene.hero.collisionStatus.talkableChr...
return 1;
return 0;
}
***Is it possible to pause and play the animation during ...
This is not possible at this time (Ver. 1.10).
----
**Resources [#pc6e0230]
***Can I toggle stamp subgraphics on and off? [#yaae21e7]
Please use the following.
mapChr.SetSubGraphicOpacity
***Can I toggle stamp subgraphic "Apply Position Only" on...
Subgraphic positions are interpreted in mapChr.DisplayObj...
It can be obtained using the following.
((Yukar.Common.Resource.GfxResourceBase)mapChr.getGrap...
#br
''Changes are not recommended, as they will directly rewr...
***Can I specify the relative position XYZ, relative angl...
The following pos, rot, and scale manage these information.
((Yukar.Common.Resource.GfxResourceBase)mapChr.getGraphi...
#br
''Changes are not recommended, as they will directly rewr...
***Is it possible to toggle on/off the "Use" of the local...
The following useLight manages the on/off information.
((Yukar.Common.Resource.GfxResourceBase)mapChr.getGraphi...
#br
''Changes are not recommended, as they will directly rewr...
***Can I assign a motion for a slice animation and then r...
This can be done by the following way.
var spIndex = 10; // Sprite Number
var guid = new Guid("c15f94b6-d4a0-46c4-bc43-...
var zoom = 100;
var x = 640;
var y = 360;
mapScene.spManager.ShowPicture(spIndex, guid,...
Microsoft.Xna.Framework.Color.White, new ...
The GUID of the slice animation can be obtained by right-...
Unlike Graphics.drawImage, this can be executed only once...
It can be moved with "mapScene.spManager.Move" and remove...
This is the class used in the "Display Image" event panel.
***Is there a code that specifies the color, intensity, a...
The following procedure can be used to set up the settings.
var index = 1; // Target subgraphic number
foreach (var obj in mapChr.DisplayObjects)
{
if(obj.index == index && obj.instance is ...
{
lgt.setIntensity(Intensity);
lgt.setColor(Color);
lgt.setRadius(Radius);
}
}
#br
''Changes are not recommended, as they will directly rewr...
----
**Map Related [#jcf81255]
***Is there a method, like in the Map Editor, for an obje...
This feature is not available in the engine because it us...
***Is there any way to obtain the coordinates specified i...
Please use the following.
mapScene.map.mapCameraRange
if(mapScene.map.mapCameraRange == Rectangle.Empty) is tru...
***Can I change the "Skybox Model" and "Environment Map" ...
Set the model GUID in
mapScene.mapDrawer.renderSettings.skyModel
and then after setting the environment map texture GUID in
mapScene.mapDrawer.renderSettings.reflection
execute
mapScene.mapDrawer.setRenderSettings(mapScene.mapDrawer.r...
***Is there a code to specify the color, intensity and ra...
You can change it with the following code.
var lgt = mapScene.mapDrawer.mapRom.localLights.FirstOrDe...
lgt.setIntensity(Intensity);
lgt.setColor(Color);
lgt.setRadius(Radius);
***Is there code to obtain and specify values for "lights...
It can be obtained from mapScene.mapDrawer.renderSettings.
Regarding the settings, some options are reflected by cha...
To change the elements that require loading of resources ...
----
**Map Battle [#v56750a1]
***Is there a code to change the Category (ally, enemy, b...
The following code can be used to obtain the cast type of...
var type = mapChr.rom?.CastType ?? Yukar.Common.Rom.Cast...
Refer [[Collision Detection between Cast Members and Even...
***Is it possible to change the color and size of the dam...
It is possible with the following code.
var viewer = mapScene.fieldBattleViewer;
viewer.zoomedScale = 2.0f; // Scale at just t...
viewer.damageScale = 1.0f; // Eventual scale
viewer.zoomTime = 0.1f; // Time to reach even...
viewer.drawTime = 1.0f; // Time until damage ...
viewer.damageColor = Microsoft.Xna.Framework....
viewer.criticalDamageColor = Microsoft.Xna.Fr...
viewer.criticalDamageColor = Microsoft.Xna.Fr...
You can also create your own damage rendering process usi...
[[ChangeFieldBattleViewer.cs:https://rpgbakin.com/pukiwik...
***Is there a way to generate critical damage during map ...
Since the judgment is made randomly based on the critical...
It would be a good idea to use state changes to temporari...
***Is it possible to specify how long it takes for a dama...
You can still obtain the information by using the followi...
mapChr.rom.InvincibleTime
''However, the change is not recommended because it would...
***Is there a code to change the color of damaged casts (...
There is a definition in MapCharacter.invalidDamageColor.
----
**Game Definition [#ka7379f4]
***Is it possible to obtain/change the ON/OFF of "Basic O...
You can switch using the following.
GameMain.instance.data.start.controlMode = Yukar.Common....
GameMain.instance.data.start.controlMode = Yukar.Common....
***Can I obtain/change the "Talking Detection Scale" in R...
The scale itself can be obtained with GameMain.instance.c...
''However, changes are not recommended since they directl...
''It is not recommended to change the values for GameSett...
***Is it possible to obtain/change the ON/OFF of "Disable...
It can be obtained and changed using the following.
mapScene.mapFixCamera
In addition, individual enable/disable for each camera op...
owner.data.start.camLockX
owner.data.start.camLockY
owner.data.start.camLockZoom
owner.data.start.camLockReset
***Is it possible to turn on/off "Terrains" and "Objects"...
You can use the following to obtain the states of each.
catalog.getGameSettings().CameraAvoidObjects
catalog.getGameSettings().CameraAvoidTerrain
''However, changes are not recommended since they directl...
***Is it possible to obtain/change the ON/OFF of "Get Beh...
It is possible to obtain information using the following.
GameMain.instance.catalog.getGameSettings().isTpsMode
''However, changes are not recommended since they directl...
***Is it possible to change the coefficients for movement...
Not possible. Please use the Game Definition settings as ...
***Can I change the "Standard Turning Speed" in Rules & O...
It is possible to obtain the speed using the following.
GameMain.instance.catalog.getGameSettings().DefaultRotat...
''However, changes are not recommended since they directl...
***Is it possible to change the "Sensitivity" of "Mouse U...
Cannot be done.
Instead, create your own process to rotate the camera acc...
***How do I display the version, creator, etc. of a proje...
It is possible to obtain information using the following.
catalog.getGameSettings().meta.buildVer
The information can then be displayed on the layout by st...
GameMain.instance.data.system.SetVariable("VariableName"...
However, running C# on the default title screen is not po...
Therefore, the title screen should be skipped in the Game...
***Is it possible to obtain the ON/OFF judgement for "Aut...
A sample code is attached.
[[ConfigGetter.cs:https://rpgbakin.com/pukiwiki_en/?plugi...
It can be obtained by executing the C# method "GetAutoDas...
----
***Is there any way to specify the friction between the "...
Please use the following.
MapCharacter.getRigidBody().setFriction(FrictionValue)
However, since MapCharacter controls friction accordingly...
***Can I change the transparency of the player and cast? ...
The following method can be used.
mapChr.setOpacityMultiplier(0.5f); // Fully transparent ...
***I have tried mapScene.hero.setOpacityMultiplier(Value)...
Regarding setOpacityMultiplier, the player is constantly ...
Try setting every frame with AfterDraw().
***Is there a code to open/close a free layout with a spe...
Please use the code below.
// To open
var lyt = catalog.getLayoutProperties().AllLayoutNodes.F...
if (lyt != null)
{
GameMain.instance.ShowFreeLayout(lyt.Guid);
}
// To close
var lyt = GameMain.instance.freeLayouts.FirstOrDefault(x...
if (lyt != null)
{
GameMain.instance.HideFreeLayout(lyt.LayoutGuid);
}
***Is there any way to change "Movement Axis is Horizonta...
Each of them is as follows:
-"Movement Axis is Horizontal and Depth"
mapScene.owner.catalog.getGameSettings().axisMode = Yuka...
-"Movement Axis is Horizontal and Elevation"
mapScene.owner.catalog.getGameSettings().axisMode = Yuka...
***Can I change the Maximum Capacity of the Inventory und...
To change the Maximum Capacity of the Inventory while the...
This value is saved in the saved data, not in the Game De...
***Is it possible to specify or change the sound effects ...
SEs can be changed by following the steps below.
var sound = catalog.getItemFromName<Yukar.Common.Resourc...
Audio.UnloadSound(GameMain.instance.se.decide);
GameMain.instance.se.decide = Audio.LoadSound(sound);
However, these are not eligible for saving to saved data ...
----
**Layout [#k0ab1c79]
***Is it possible to specify the display position of a fr...
You can do so as shown below, but since the assignment to...
var lyt = GameMain.instance.freeLayouts.FirstOrDefault(x...
if (lyt != null)
{
var node = lyt.LayoutDrawer.ParseNodes().FirstOrDefa...
node.Position = new Microsoft.Xna.Framework.Vector2(...
node.MenuItem.positionAnchorTag = "Rewrite Special C...
}
***Can I obtain the container management number (index) o...
You can access the currently displayed layout by the foll...
[BakinFunction(Description = "Obtain the containe...
public int GetIndex()
{
// First, obtain the main menu manager
var lc = mapScene.menuWindow as LayoutMenuCon...
var lm = lc.mainMenu;
// Track and obtain open layouts derived from...
// (If it's being called from item select, it...
while (lm.NextlayoutManager != null)
lm = lm.NextlayoutManager;
// Obtain the currently selected index from t...
var drawer = lm.LayoutDrawer;
GameMain.PushLog(DebugDialog.LogEntry.LogType...
return drawer.GetSelectIndex();
}
Furthermore, if you wish to force the main menu to close ...
[BakinFunction]
public void CloseMainMenu()
{
// First, obtain the main menu manager
var lc = mapScene.menuWindow as LayoutMenuCon...
var lm = lc.mainMenu;
lm.HideAll();
}
Incidentally, to obtain the currently selected index from...
[BakinFunction]
public int GetIndexForFreeLayout()
{
// First, obtain a free layout manager
var lm = GameMain.instance.freeLayouts.FirstO...
if (lm == null)
{
GameMain.PushLog(DebugDialog.LogEntry.Log...
return -1;
}
// Obtain the currently selected index from t...
var drawer = lm.LayoutDrawer;
GameMain.PushLog(DebugDialog.LogEntry.LogType...
return drawer.GetSelectIndex();
}
***I was determining if a Free Layout for Event was displ...
To look at GameMain.instance.freeLayouts.Count, please us...
// Hide all
GameMain.instance.HideALLFreeLayout(mapScene.isBattle);
// Show only selected layouts
GameMain.instance.ShowFreeLayout(layoutGuid, mapScene.is...
// Add and display selected layouts
GameMain.instance.AddFreeLayout(layoutGuid, mapScene.isB...
// Hide selected layouts
GameMain.instance.HideFreeLayout(layoutGuid, mapScene.is...
***Is there a code (code to control the visibility of eac...
Plug-in Reference: Use the Show/Hide methods in the Yukar...
If animation is not required, ShowWithNotAnimation/HideWi...
Search for "RenderContainer" in the Plug-in Reference to ...
https://rpgbakin.com/csreference/doc/ja/class_yukar_1_1_e...
***Can I use a plug-in to prevent the layout from closing...
The following method is available to prohibit cancellation.
Please try writing it in Update().
var menu = mapScene.menuWindow as LayoutMenuController;
var lyt = menu.mainMenu;
while (lyt.NextlayoutManager != null)
lyt = lyt.NextlayoutManager;
if (lyt.LayoutNode.Name == "SkillSelect") // In the S...
{
// Basically, it should be unlocked.
if (lyt.IsLocked())
lyt.UnLock();
// Cancellation Prohibited
if (Input.KeyTest(Input.StateType.TRIGGER, Input....
lyt.Lock();
}
***How do I control the display position of Free Layout f...
First, you must also specify a value for defaultPosition ...
(Also needs to access defaultPosition, so cast is also ne...
var node = lyt.LayoutDrawer.ParseNodes().FirstOrDefault...
node.Position = node.defaultPosition = node.MenuItem.po...
When the sprite used for the animation switches, it gets ...
Currently, the position is specified by SetLayoutPosition...
----
**Database [#xb53bdd7]
***Is it possible to retrieve the Management Tags + Notes...
This is the case for the field named tags.
You can access it by the following.
catalog.getItemFromName<Yukar.Common.Rom.Cast>("Hero").t...
***Is it possible to obtain a list of the skills that the...
The skills that a cast member learns are in Cast.availabl...
var learnSkills = catalog.getItemFromName<Yukar.Common.R...
Skills are stored in the form of GUIDs, so Achievement Le...
if (learnSkills.Count > 0)
{
var skill = catalog.getItemFromGuid(learnSkills[0].s...
GameMain.PushLog(DebugDialog.LogEntry.LogType.EVENT,...
}
A complete list of all skills can be obtained by the foll...
var allSkills = catalog.getFilteredItemList<Y...
***Is it possible to obtain Money in Possession or droppe...
You can obtain the EXP of the first monster by the follow...
BattleSequenceManagerBase.Get().EnemyViewDataList[0].mon...
You can also obtain the first drop item of the first mons...
var guid = BattleSequenceManagerBase.Get().EnemyViewData...
var name = catalog.getItemFromGuid(guid)?.name;
When actually using the EnemyViewDataList or dropItems, c...
**Sound [#heed049c]
***Is there a code to play sound effects? [#p8b95615]
Please obtain rom from catalog as follows.
var rom = catalog.getItemFromGuid(guid) as Yukar.Common....
Audio.LoadSound(rom);
----
**Others [#lc600476]
***Can the background music be crossfaded? [#af79a21f]
BGM as a system has only one playback line, so it cannot ...
First, use the following method to start playback with ze...
var id = Audio.LoadSound(guid);
Audio.PlaySound(id, 0, 0, 1);
Then use the following to manipulate the volume every fra...
Audio.SetSEVolume(id, volume);
***Can I switch the battle camera during a battle? [#i83a...
You can change it with the following code.
GameMain.instance.data.system.currentBattleCa...
The camera will be reflected at the time of camera switch...
mapScene.applyCameraToBattle();
Please note, however, that this is only effective from th...
***If I want to display a specific image, how should I wr...
First load the texture using the following code in Start(...
tex = catalog.getItemFromName<Yukar.Common.Re...
Graphics.LoadImage(tex);
Then, use the following at the scene you wish to render (...
Graphics.DrawImage(tex, x, y);
After use, release the image used when the event is disca...
public override void Destroy()
{
Graphics.UnloadImage(tex);
}
***Is it possible to use the event generation mapChr.Crea...
It is available for use.
It can be used like mapChr.CreateEvent(guid, dir);.
mapChr.getDirectionRad() should be passed for dir if you ...
guid is the GUID of the cast.
It would be better to use catalog.getItemFromName("name o...
Once a GUID is created for a cast, it does not change. Th...
***What value does the getRelativeParam60FPS function in ...
getRelativeParam60FPS is the elapsed time from the previo...
In other words, this method returns the time taken for on...
#br
Within the C# script Update(), frameCount++; will add 1 t...
However, this method will result in the addition of non-"...
Therefore, instead of frameCount++, frameCount += getRela...
***Util.UnProject2World() is used to find the coordinates...
Util.UnProject2World() is a method that converts XY coord...
Pass the projection and view matrices of the current came...
Basically, assign mapScene.CurrentPP, mapScene.CurrentVV.
***When TOUCH is assigned to KeyState in Input.KeyTest(),...
Input.KeyTest() is a method that obtains the state of the...
The purpose is to simulate touch behavior, so it is proce...
If you want unprocessed values, assign SYSTEM instead of ...
***Is there a way to change the player's position during ...
Since using setPositiion will reset velocity, instead, ta...
***Is it possible to change the value of the camera tool ...
If the change is made from a C# script, it will be as fol...
Camera
mapScene.CameraManager.ntpCamera
Key Frame
getKeyFrame()
DOF
Yukar.Common.Rom.Camera.KeyFrame.dof
X=Focal Coefficient, Y=Focal Range Coefficient, Z=Blu...
Please note that changing the value using a C# script wil...
***How do I obtain the save data storage slot number (0-)...
The save slot number is obtained in var index.
[BakinFunction(Description = "Description")]
public void Func()
{
var lc = mapScene.GetMenuController();
var lm = lc.mainMenu;
var index = lm.SelectProp.SelectSaveIndex;
}
var lm = lc.mainMenu will be if saved from the Main Menu.
If it was saved from an event with "Display Save Screen",...
Page: