RPG Maker MV - Left Handed Weapon is classed as Armour - rpgmakermv

I have recently been using RPG Maker MV to set up some weapons and mechanics for my own RPG project. I created a new equipment type which I named 'L.Hand' for left hand. I want the player to be able to equip a weapon or shield in this slot however it has appeared as an armour slot, not a weapon slot.
If anybody knows how to fix this it would be much appreciated if you could let me know.
Many Thanks,
Tommy Eaves

You seem to have renamed an armor type, only the first equipment type is a weapon slot. As far as I can tell, normal RPG Maker doesn't support having multiple weapons, you'll have to use a plugin.
Download this, and save it to the plugin section of your game's javascript files: Documents/Games/projectname/js/plugins/
Then go to the plugin section of the program and add the new plugin.
Afterwards, the actor's Initial Equipment section becomes useless, you will need to instead use the notes section to provide them.
<equip slot: Weapon>
<equip slot: Weapon>
<equip slot: Shield>
<equip slot: Head>
<equip slot: Body>
<equip slot: Accessory>
This should enable the use of multiple weapons, and you can remove one if you don't want that actor to have that equip slot.
Remember to do this to all of your actors, since it won't do this on its own.
I hope this has been helpful, hopefully you don't object to esoteric plugins like this.
Edit: look at the info for the plugin for further instructions and information.

Related

QtMenuBar need assistance with "receiver" Resolved, only in previous version

Qt and Linux novice. From the documentation:
insertItem(const QPixmap & pixmap, const QObject * receiver, const
char * member, const QKeySequence & shortcut = 0, int id = -1, int
index = -1)
I can create a qt window with a menu bar, and understand that the method insertItem(...) adds items. The argument: QObject * receiver is my problem. Everything I find seems to presume I know what this receiver item is. I have PDF versions of "C++ GUI Programming with QT 3", 4, and 5 and a find tells me that "insertmenu" and "insertitem" are not in the book.
Obviously this receiver is the target of a menu item click, but I would really like some details. Can it be any widget? Is the widget automatically shown? There are more questions.
In my current case, when the user clicks on a menu item named "Control" he should see a pop up dialog that provides the ability to set multiple radio buttons and line edits.
What I really want is a link to a page describes the concept of receiver and maybe provides a simple example.
Eyllanesc's comment is correct. We remain mostly stuck with Qt3 but have Qt4 available so I am trying to use Qt4. I forgot and referenced the Qt3 book and tried to use that. (Two reasons: Qt 3 still works and management does not want to spend money and time to upgrade. And, rumor has it that the Qt company now has non-US ownership and that is a problem for government projects. I presume, but do not know, this was not the case for Qt 3 and 4.)
But we can use Qt4, I will redirect myself.
Thank you for the reply/comment and this is resolved.

Raycasting from player, hitting object and setting off custom event C++ UE4

I've been going in circles for a day now trying to get this going and I'm just getting nowhere. I'm trying to have multiple objects in the scene with individual animations and when I fire a raycast from my player and it hits one, have the UFunction(blueprintimplementableevent) go off on the object that it hits. Please help me this is absolutely stumping me.
What I would do is use a BlueprintNativeEvent. This will allow you to create an Implementation function of the stuff you want to happen in C++, as well as a blueprint implementation, which can be different for each blueprint of that object type.
It is quite simple to use as well, for example, in your character's header file:
/** Called when the player presses the fire key */
UFUNCTION(BlueprintNativeEvent, Category = "Shooting")
void OnHit();
virtual void OnHit_Implementation();
And now your Cpp:
void AMyGameCharacter::OnHit_Implementation()
{
UE_LOG(LogTemp, Warning, TEXT("OnHit_Implementation!"));
// Do whatever stuff you want to do in C++ here
}
Now over in your character / actor blueprint, just go to the event graph, right click, and add the event of type OnHit. Make sure that you make a callback to the parent OnHit event though (right click on the event and hit "Add Call to Parent Function")
If you want an example of this you can look at the C++ Battery Collector series or the docs.

Signals and Slots in Qt4

I'm trying to create a signal and slot in Qt4 and I am fairly new to Qt. From what I understand in Qt5 it is just created automatically and this is not the case in Qt4 it seems. I'm trying to create a an action when the user clicks on an option in the menu bar at the to of the UI.= I see that there is a Signal/Slot editor at the bottom of the screen with options "Sender", "Signal", "Receiver", and "Slot". I'm not entirely sure how to use this function. Any help is appreciated.
Basically you need to connect your signal and slot
connect(ui->button1, SIGNAL(clicked()), this, SLOT(yourSlot()));
and in this link there is good example about signals and slot: signals and slots in qt.
You seem to have misunderstood.
The difference in Qt 5 is that it offers new syntax to make the connections.
The connection is "automatic" when you don't specify the connection type, i.e. direct, queued, etc, the default is automatic, which makes Qt check the object's thread ownership and select the appropriate connection type.
Connections must either be explicitly made in code, or be made using the UI editor, and while the latter may save you some typing in some cases, in general most of the connections you end up making are explicit in code, so you better learn how to do it, because the UI editor can help you only in a few corner cases. I haven't really used the UI editor for connections, and have tried it once or twice years ago, but the limitation I think is that you can only make connections between UI elements and signals and slots of the widget.
Consider that signal and slot connections are not merely a UI thing, it is a core principle in Qt and UI is just one of its many uses.

Unable to understand Undo Redo Framework in Qt

I am learning to use Qt for my application development & I am pretty successfull in developing my Application. Now I want to implement Undo Redo Functionality for my Application. The doc for this topic has little information. I have even tried understanding from the 2 examples in the SDK. But I am having a tough time understanding how it works.
Can somebody please take the trouble of explaining me how to implement it?
There are various state's in my application for which I want to provide this functionality.
So can the explaination be from the general point of view?
If there are already articles on the internet explaining the same then please notify me about them. That would be very helpful.
Thank You.
There are 2 core classes: QUndoCommand and QUndoStack;
QUndoCommand is the base class of your command class. You have to implement undo() and redo() yourself.
QUndoStack is basically a container of QUndoCommand objects, with extra methods like creating QAction, query undo/redo text of current QUndoCommand(Simple functionalities which you can implemented yourself easily)
What you need to do is:
Implement your commands. You need to decide how to implement redo/undo yourself according to your need. class AppendText is a good example: http://qt-project.org/doc/qt-5.0/qtwidgets/qundocommand.html
Keep a QUndoStack instance for each document(Or one instance if there is only one document in the application).
Say you have an "AppendText" command class, and an "Append" button in the UI. If "Append" button is clicked, you need to create an AppendText command instance, and call QUndoStack::push(appendCmd). QUndoStack::push() will call AppendText::redo() first, and then put it into the container for undo.
That's it.

Qt/C++ - confused about caller/callee, object ownership

I am creating a GUI to manipulate a robot arm. The location of the arm can be described by 6 floats (describing the positions of the various arm joints.
The interface consists of a QGraphicsView with a diagram of the arm (which can be clicked to change the arm position - adjusting the 6 floats). The interface also has 6 lineEdit boxes, to also adjust those values separately.
When the graphics view is clicked, and when the line edit boxes are changed, I'd like the line edit boxes / graphics view to stay in synchronisation.
This brings me to confusion about how to store the 6 floats, and trigger events when they're updated. My current idea is this:
The robot arm's location should be represented by a class, RobotArmLocation. Objects of this class then have methods such as obj.ShoulderRotation() and obj.SetShoulderRotation().
The MainWindow has a single instance of RobotArmLocation.
Next is the bit I'm more confused about, how to join everything up. I am thinking:
The MainWindow has a ArmLocationChanged slot. This is signalled whenever the location object is changed.
The diagram class will have a SetRobotArmLocation(RobotArmLocation &loc). When the diagram is changed, it's free to change the location object, and fire a signal to the ArmLocationChanged slot.
Likewise, changing any of the text boxes will fire a signal to that ArmLocationChanged slot. The slot then has code to synchronise all the elements.
This kind of seems like a mess to me, does anyone have any other suggestions? I've also thought of the following, does it have any merrit?
The RobotArmLocation class has a ValueChanged slot, the diagram and textboxes can use that directly, and bypass the MainWindow directly (seems cleaner?)
thanks for any wisdom!
Except for really simple cases (e.g. a label that shows the value of a slider) my experience has been to stay away from inter-component signal/slot connections inside Qt Designer. Rather, have the component firing the signal of interest connect to a slog defined in the top level QWidget class you're subclassing (i.e. QMainWidow, etc... let's just call it the Form class). You can also go the other way: if you have a custom signal in the Form class, you can connect it with Qt Designer to one of the public widget slots.
To be specific using your example:
I'm going to assume that you have subclassed QMainWindow and QGraphicsView. Let's call the subclasses RobotMainWindow and RobotView.
RobotMainWindow contains the QLineEdit fields and RobotView. The way you specify RobotView in Qt Designer is to insert a QWidget and use the Promote to... feature to tell Qt that the QWidget should be replaced at compile time with your custom RobotView.
Name the QLineEdit fields edit1, edit2...edit6.
In the Qt Designer signal/slot editor define slots in RobotMainWindow to be called when the value in a QLineEdit changes. There are some more elegant ways of doing this, but for simplicity let's say you define 6 slots named setValue1(float), setValue2(float), etc.
In the source code for RobotMainWindow, go declare and define these slots, such that they update your arm, shoulder, whatever.
Also in the source code, define a signal valueChanged() (or multiple for each field, your choice). Have the slots you defined emit valueChanged().
Back in Qt Designer you can now link the appropriate signal from each QLineEdit to the corresponding slot in RobotMainWindow.
Back in the signal/slot editor add the valueChanged() signal to the RobotMainWindow (so Qt Designer knows about it). Connect this signal to a new slot in RobotView, using the procedure above, so it can update the rendering.
Repeat all of this for handling changes from RobotView to the editing fields (via RobotMainWindow.
In short, I think you'll find everything more straight-forward if your route the signals through your Form subclass (which I think of as the Controller in MVC parlance).