Game Objects trouble(Adventure module)

4Y@NLICH85

New member
I was trying to get the characters weapon to show up in the game as I made the Melee V and Melee H as well as making the right adjustments in the game objects but when I tested the game the players sprite would make the attack animation but the weapon won't appear though when I click the a button the sword would show up but not in the correct area. Also when I hit the f key on my key board the sword does appear but not in the right position and my character can't move until I hit the d key. I think this would have to do with my object details but am not sure were to start. Help!
(d = b button & f = a button)
 

dale_coop

Moderator
Staff member
Melee_V and Melee_H is to define which tile to use for your weapon vertical and for your weapon horizontal.

Then you have to adjust the Offset, select "Game Objects" and set the X and Y position of your Melee for your player's directions:
2019-02-23-08-59-56-NES-MAKER-4-1-4-Version-0x158-Mon-Jeu-Aventure-MST.png

(don't care about the melee graphic, it can't render the real Melee_V and Melee_H)

For your buttons issue, you have to set your Player's action step 3 (=attacking) to "GoToFirst" after a timer value:
2019-02-23-09-00-15-Monster-Animation-Info.png


VoilĂ , it should work better.
 

4Y@NLICH85

New member
okay so I got my button issue fixed, but my only issue now is the offset settings. After I made the right adjustments that I wanted, the melee weapon was not in the spot that I set it in. Though the sword does show up when I click the "f" key but the "d" key when I hit it show my player sprites leg for some reason. The buttons now work properly it's just the placement that had the sword just won't show in the correct spot when I test the game. What should I do? (Thanks once more)
 

dale_coop

Moderator
Staff member
What is "f" what is "d" ? You mean your "B" button and your "A" button?
What are the scripts assigned to those buttons ?
 

4Y@NLICH85

New member
"d" is the "B" button & "f" is the "A" button. "B" is assigned with create melee and "A" is create projectile. Though for some reason "f" creates the melee weapon when I test the game.
 

dale_coop

Moderator
Staff member
Check the two scripts... they use user constants for the CreateObject. Those constants are defined in Project Settings > User Constants.
Set the correct values for both (the correct number corresponding to the game object used).

Could you illustrate your issue with aveeenahots, we will try to help you fixing it.
 

4Y@NLICH85

New member
The images would on this link:
https://docs.google.com/document/d/1HoRfTsm_rWrgahvEEaqwCS-yx8FkJ443v7phITH7dcY/edit

The first image is what I have the sword set as.
The second image is what happens when I test it.
The next three images after that are the object details on the melee for animation, details, and actions.
The last image is of the input editor just in case.

Sorry with the inconvenience with the google docs but the forum site is preventing me from attaching any more images.
 

dale_coop

Moderator
Staff member
Oh, you are using a game object for Melee? Not the sprite based sword?
So you don't need to set Melee_V and Melee_H and SPR_WEAPON constants... because that constants are for the sprite based one.
And have you disabled the sprite based sword code in the script assigned to your "Handle Sprite Pre-Draw" and to your "Handle Sprite Weapon" in Project Settings > Script Settings.
For the "Handle Sprite Pre-Draw", modify it, adding a line "RTS" around line 51.
And for the "Handle Sprite Weapon", just assign a BlankScript to it.
 

dale_coop

Moderator
Staff member
Don't know man, what do you want to use... the sprite based sword or the object melee?
The Object melee is better if you want to use an animated weapon or a weapon bigger than 8px or if you more at ease having a Melee object (like your projectiles)
The sprite based sword is just a tile in your tileset... drawn next to your Player... when he 's in attacking state.

You free to choose the one you prefer. Then, we can activate/deactivate some code/scripts.
 

4Y@NLICH85

New member
Okay I will stick with the object melee thank you for make it clearer. Also I have a couple questions, one what is an "RTS" line? Also when I tried to open modify the "Handle Sprite Pre-Draw" would I use notepad or should I get a different application?


Also in the first image am I assigning the right script to "Handle Sprite Weapon"?
https://docs.google.com/document/d/1HoRfTsm_rWrgahvEEaqwCS-yx8FkJ443v7phITH7dcY/edit?usp=sharing

Thanks bearing with me this long.
 

dale_coop

Moderator
Staff member
A "RTS" line is a line with just the RTS opcode:
Code:
	RTS
And this mean return from the fonction (routine), so the code after the RTS, will not be executed.

For modifications, I would suggest you to download and install "Notepad ++" (You can open multiple scripts in different tabs, you have the line numbers, etc...)

On your first image you have assign the BlankScript to "Handle Sprite Weapon" that is perfect... but for the "Handle Sprite Pre-Draw", you need to keep it to "Routines\Basic\ModuleScripts\MainScripts\AdventureGame\PreDraw.asm".
 
Top Bottom