Setting a Variable Issue

I'm working on setting up a battle system using events, variables, and switches. I am trying to set the characters damage variable to the corresponding characters attack parameter but, it won't set it. It stays at zero. I have the right options and selections checked in the variable menu but, alas it will not set the variable to the characters attack parameter. Any ideas of why not or how to fix this? photo.JPG Forgive the strange quality I used my ipod to take the picture. XD lol
That seems to be okay. Show us the whole event page - it's probably something to do with the conditions of when it gets called (ie - it's NOT actually running that command) rather than the command itself.


Also, use screenshot rather than actually taking a picture of a computer screen. MUCH easier for us to see.


How to take a Screenshot:


You've heard people say to take a screenshot, but how does one take a screenshot of their game? Simple, while the game is running, hit the Prt Scr button on your keyboard, which is located right next to your F12 key. If you're using a laptop, you might have to use the Fn key in combination with the Prt Scr key to get it to work.

Now that you've pressed the button, it's time to paste this screenshot into an image editing software. If you don't have anything fancy such as Adobe Photoshop, GIMP or Paint.NET, no worries; you can use MS Paint instead. Open up your image editing software, create a new file, and then hit ctrl+v on your keyboard, or simply right click on the screen and select paste. This should instantly paste the screenshot into your image editing software. You can go ahead and crop the image to suit your needs, or if you don't even know what that means, you can just upload it as it is.

Save the image as a PNG, or if you really need to, as a high quality JPG.
1) Make sure the actor is already present

2) Make sure you don't have any other scripts or events that might be modifying the variable

3) If it still doesn't work, just try using this in Script call

Code:
$game_variables[13] = $game_actors[id_of_that_actor].atk
PS: if you're using win7 and up there's a tool called Snipping tool that lets you snip parts of the screen and save it as an image... else you can hit print screen then paste into paint and crop the image to show only the needed area...
Alright sorry, I didn't know how to take a screen shot before, thank you. Also the character is present and no other events are modifying the variable, just the one event. Also I don't know how to use the spoiler tags either, I apologize if I needed to with this post.ScreenShot.png
what is the content of variable 28? that is modifying your damage variable, and it might be the cause of this problem.
It's the variable for the enemy's defense stat. It does modify it to decide the final damage but, it's only 5 and the character's attack stat is 7. So the end result should be 2 but, it keeps ending up with -5. It act's like the original variable is never set. I even tried just setting up a simple command event to do, set variable: Char's damage to Char's Attack Parameter. Even with that it still stays at zero, it won't ever set the variable to the characters attack stat.
just try the script call I gave you... I'm not sure about this but I do think I had that same problem last time I used the event command for setting a variable to an actor parameter
Alright, thank you. Yeah, for some reason it won't let me set variables to the character's parameter numbers. The game I'm making is going to be a commercial game though so, I'll have to make sure it's okay for the script to be used though. Either way, thank you very much. 🙂
It's just a direct script translation of what the event should have done... XD
Ah, okay. Lol, I don't really know too much about the scripts myself. XD Once again thank you for the help.
btw, there are two ways to use it


1) Using the script command on the third tab of the event commands and use that whole line


2) Use Change Variables, select your variable then go to the last tab of that and put this on the script part there

Code:
$game_actors[id_of_that_actor].atk
Hmm, okay. Mine doesn't have the tabs in the change variable so, I'll just have to use the script event command.
ah I see... never knew VX didn't have that... oh well, it was way too long ago when I last used VX...
You need the variables fix, it's a bug in VX that some variables won't work and will stay at zero. Get it here.

Original thread: https://forums.rpgmakerweb.com/threads/setting-a-variable-issue.25784/