Some questions

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Some questions

Post by SwordPlay »

Howdy all. Some quick questions for anyone who can answer (would be nice) and thank you for all your hard work on the engine so far, it has come a long ways and despite many quirks, it's a dang work of art and beautiful, wonderful tool to create RPGs! Truly one of a kind.
I'm still learning about it, and I'm trying to get into plotscripting, however I am a bit intimidated tbh.

Questions.
1. Is it possible to make the screen shake or tremble?
2. How can I display a heroes stat, for example, in a slice?
3. I made some life draining attacks, but it affects money, and I don't know why! (edit: also healing spells!)
4. When chaining attacks, how can I make it so that the attacker does not return to their position in-between attacks?
5. If a target is off-screen (i.e. in the air) can they still be targeted, and by what?
6. How can I get text boxes to display stored information? Must this be done through plotscripting?
7. How can I display in battle the number of items remaining if that item is used to pay for an attack?

Thanks!

EDIT
More questions
8. Is there a way to draw a border or box around the game screen?
9. Can I edit placement/appearance of on-screen touch controls for e.g. android? (yes or no will suffice for now :p)

EDIT EDIT
10. What kind of values/strings can be displayed from text-boxes and slices? Can I display stored information in attack descriptions etc.?
11. Can I change a heroes battle-menu in combat? Can I make the appearance of a command dependent on a tag, for example?
Last edited by SwordPlay on Sun Jan 22, 2017 9:55 am, edited 2 times in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

Hi! I'll answer as many of these as I can right now. I'm very tired, but some of these have simple answers.

1. Yes, it is possible using the "pan camera" command via plotscripting. This page on the wiki describes it in more detail: http://rpg.hamsterrepublic.com/ohrrpgce ... g_shake%3F

2. If you want to have a box in which the number is displayed, you'll want to make a variable and set it equal to "create rectangle" to give it a handle. Then alter the rectangle however you want, including style, position, etc. After that, you'll want to create a text slice and position it inside of the rectangle you made. Then, use a string to store the hero's stat you're looking for using "append number" and display it by using "set slice text" on the text slice you made.
Keep in mind all plotscripting commands are elaborated on in the dictionary here: http://hamsterrepublic.com/ohrrpgce/docs/plotdict.xml

3. It sounds like you've set a cost for the attack in the form of money. You'll want to make sure that in the attack under "cost," it's charging HP and not $. If that's not the problem, then I'm misreading what you meant.

6. This would be done most effectively through plotscripting. If you go into the textbox editor, edit the text, it will explain the codes you can use at the bottom. These include typing "${V#}", which will be expanded to write the value of a global variable, the ID of which you specify with the #. You can also display strings saved via plotscripting this way.

8. Yes. This can be done with plotscripting one of two ways. You can manually create a box using commands like "create rect" and "set slice x" and "set slice align". Or you can create a slice collection by going to "Edit Slice Collections" from the home menu of the Custom Editor. These slice collections can be loaded using plotscripting with "load slice collection(id)" and removed using "free slice(handle)". (You can also use "set slice visible(handle, true/false)" to make it temporary disappear). FYI: a slice handle is typically the variable pointing to a slice. For example,

Code: Select all

variable(sl)
sl := load slice collection(0)
set slice visible(sl, false)
10. Any global variable defined in your game's .hss file(s) can be displayed in a textbox by typing "${V#}". Strings can be displayed similarly using "${S#}". You can display just about anything in a slice, as long as there's a command to get it. From what I'm seeing right now, you can store an attack's caption using "get attack caption (ID, attack)" but I am not sure about the description.

11. My initial answer is no, but be more specific about what you're trying to do and there might be a work-around.

I hope this all helps. Sorry it's not as detailed as it should be. It's getting very late. Good luck with your endeavors, and don't feel bad about being intimidated. Plotscripting is pretty confusing until you get comfortable with it. There are some good tutorials on the wiki, too. http://rpg.hamsterrepublic.com/ohrrpgce ... g_Tutorial
My pronouns are they/them
Ps. I love my wife
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

thanks for the reply!
solved most of my problems :p

for 11., I want to have a character enter a special state where normal attacks/commands can't be inputted, and a new list of attacks appears instead while they are in this state.

again, thanks for the answers, I super appreciate it.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

yay! created my very first script!
It's wrong, but it works! :p
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Hello!

2. There are a lot of possible ways to display a number on-screen. If you want to display something involving multiple slices (e.g. a box and a text slice), you might find it easier to create the slices beforehand with the slice editor rather than entirely by script, as kylekrack mentioned, so that you can see what you're doing, and then just change the text slice by script.
Aside from slices, you could just put it in a textbox with a ${V#} code (after using a script to put the value in a global variable) or even just use showvalue or showstring/showstringat.
(Sorry, ${V#} doesn't work in text slices yet, or that'll be the best solution.)

4. I don't think this is possible... unless maybe you use the instantaneous 'Teleport' Attacker Animation and no attack delay? (I doubt it, though)

5. Yes. Using Jump makes no difference to anything aside from position

7. I'm afraid you can't. That should probably be displayed in the spell/skill menu...

9. You can customise the button appearances, see here. No option to change their position.

10. Hmm, there are commands to read the name or caption of an attack, but not the description. I'll fix that.

11. Oh damn, I keep forgetting that this hasn't been implemented yet. I'm doing it now. It'll open many possibilities!


In general, the battle system is pretty inflexible (it's definitely the most limited part of the engine), especially because scripts can't run in battle. However attacks can do a lot of different things aside from doing damage, so there are often ways to get around the limitations by clever use of attacks, attack chains, tags, transmogrification (turning an enemy into another), elements, putting temporary values in unused hero/enemy stats, and so on.
Last edited by TMC on Sun Jan 22, 2017 1:46 pm, edited 2 times in total.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

great news! Thanks for the detailed replies.
I am currently exploring the engine.
Compared to a few years (?) ago when I first glimpsed it, it seems to have expanded a lot of features and become much less constrained!
It seems infinitely more usable compared to back then.
So far it has become a powerful engine with diverse tools. I think it's great, even compared to commercial game making software, and definitely holds its own, with a lot of promise if used correctly!

I am trying to learn plotscripting now. I wrote my first script! Yay! But I don't know how to make it update automatically/continuously during play. Working it out as I go. It's fun to script!

You lot are right friendly¬! Super appreciate it :)
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Make it update continuously? What do you mean?

I'm guessing that the answer to your question is a 'while' loop. For example, this script constantly displays the player position at the bottom of the screen:

Code: Select all

plotscript, show position, begin
  while (true) do (
    string sprintf (0, $0="Position: X=%d, Y=%d", hero x (me), hero y (me))   # This reuses string ID 0 twice
    show string (0)
    wait(1)
  )
end
The 'wait' is important, otherwise the script appears to be stuck in an infinite loop.

You can set that as a new game script. If you want such a loop to run on a specific map, use a map auto-run script and write "while (current map == whatever)" instead. Also, if possible use an each-step or on-keypress script instead, then you don't need a while loop, which avoids problems with scripts suspending each other (a big limitation of scripting, currently). The above script would be simpler as an each-step script:

Code: Select all

plotscript, show position, begin
  string sprintf (0, $0="Position: X=%d, Y=%d", hero x (me), hero y (me))   # This reuses string ID 0 twice
  show string (0)
end
(Time for bed!)
Last edited by TMC on Sun Jan 22, 2017 3:04 pm, edited 5 times in total.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

ah, yes, thank you, 'while' indeed appears to be what I'm looking for. cheers :p
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

OK, I've added an option to disable a battle menu item based on tags, and some other useful options too. You will be able to download a nightly build soon (within 12 hours I think) if you want to try it out. Do read the warning though. Or play it safe and just wait for the next release.
Last edited by TMC on Mon Jan 23, 2017 3:35 pm, edited 1 time in total.
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

how awesome!
Post Reply