Non-threaded
Forums
»
Advanced Editor Forum
»
Read Thread
Get help from the experts on variables, scripts, items, and other scary things.
Pessial
Reply
Adding Variables
2 years ago
Okay, so complete newb question, but how do I properly add variables? I'm playing around with making a combat system and I'm following the instructions given with how they'd be added, but it isn't working. Specifically, I'm trying to add a static variable to a random one.
For example, I'm trying to set it up where the damage/attack rolls for the characters and monsters are random each time (that's gone well) and I can add or subtract things from that roll to add an extra element to the combat. So it would look something like this upon the monster attacking:
%MONSTDAM := 4D4
PLYR1HP := PLYR1HP - (%MONSTDAM + 6)
I use the reset function for the monster's damage and that works by itself, but it ignores anything I try to add to it. In this example, the monster's overall damage shouldn't be lower than 10. I've also tried subbing the 6 on its own with a variable that's set at 6, but to no avail. Any advice? Am I missing something?
EDIT: Nevermind, I figured it out what I was doing wrong.
Mizal
Reply
Adding Variables
2 years ago
Great, excellent. Good talk, I'm glad we could resolve this.
Celicni
Reply
Adding Variables
2 years ago
You could have explained what you were doing wrong. Maybe would help someone else in the future.
Ogre11
Reply
Adding Variables
2 years ago
^ This has happened to me more times than I can count
Pessial
Reply
Adding Variables
2 years ago
Yeah, fair point.
I just needed to remove the space between the addition of the variables and it worked fine.
Instead of
PLYR1HP := PLYR1HP - (%MONSTDAM + 6)
It should be
PLYR1HP := PLYR1HP - (%MONSTDAM+6)
Removing that space has been working for these types of variable interactions so far.
BerkaZerka
Reply
Adding Variables
2 years ago
Well, whatever you did to fix it, that was not it, as scripting ignores all spaces and line breaks that are not between quotes...
Your scripting could literally be one giant wall of text with no spaces and still run fine.
Pessial
Reply
Adding Variables
2 years ago
Just realized I still typed it wrong. It was
PLYR1HP := PLYR1HP-(%MONSTDAM+6)
In any case, I’m not sure what I did if that was not it. I was trying several things to fix the issue and I was testing it as I did something new, and that’s what ended up working for me.
Home
Storygames
Random
Search
Newly Created
Top Rated
Fantasy
Grimdark Fantasy
Sci-Fi
Modern
Horror
Love & Dating
Mystery / Thriller
Family Friendly
Historical
Puzzles / Games
Edutainment
Fan Fiction
Forums
Newbie Central
The Lounge
News & Updates
The Parlor Room
Creative Corner
Writing Workshop
Reading Corner
Adv. Editor Forum
Wishing Well
Bugs and Problems
My Stuff
Storygames
Pictures
Messages
Notifications
Duels
Saves
Comments
Points
Commendations
Notepad
Profile
View Profile
Help & Info
CYOA History
About Us
Privacy Policy
Terms Of Service
Logon
version 23.22 | ChooseYourStory © 2001 - 2024, Halogen Studios Entertainment |
contact us