Post new topic    
Page «  1, 2, 3, 4, 5, 6  »
Metal Slime
Send private message
 
 PostTue Feb 15, 2011 9:30 pm
Send private message Reply with quote
i set the bitset. i changed the script so that the text box is shown first. when the game is loaded, the text box appears. the script IS running. the battlemode option appears as Wait, rather than Active which is the default, in the menu. but it still doesn't actually set the battlemode to wait. this is the script that toggles the option ingame.

Code:
plotscript, battlemode toggle, begin
if (check tag(69)) then, begin
set tag (69,off)
set battle wait mode (off)
end, else, begin
set tag (69,on)
set battle wait mode (on)
end
end


this script works like it's supposed to. it just doesn't set when the game is loaded, no matter what the option is set to. the menu itself looks like this.

Volume
Battlemode:Active <=set to appear if tag 69 is on
Battlemode:Wait <=set to appear if tag 69 is off
Quit Game
Back

ideas??
Metal Slime
Send private message
 
 PostTue Feb 15, 2011 9:58 pm
Send private message Reply with quote
Does the map where you're saving have any autorun script? Or is there any other script that could be run that could be interfering with this one? I can't think of anything else that might be causing this problem.
I am Srime
Metal Slime
Send private message
 
 PostTue Feb 15, 2011 10:11 pm
Send private message Reply with quote
the only autorun scripts i have set, aside from inside nidavellir cave, are these ones:

Code:
plotscript, on world map, begin
set tag (18,on)
end

Code:
plotscript, off world map, begin
set tag (18,off)
end


they are only used to designate whether the player is on the world map and able to use the flight spell. these scripts do not interfere with the script, i believe (otherwise i wouldn't have seen the text box pop up when i took james' suggestion by adding a text box before any tags are checked). ideas, anyone??
Liquid Metal King Slime
Send private message
 
 PostTue Feb 15, 2011 11:02 pm
Send private message Reply with quote
Hmmm... So tag 69 should be off when battle wait mode is off. and tag 69 should be on when battle wait mode is on. But the load game script is causing a mismatch between the tag and the actual wait mode...

When I look again at your load game script, it seems to be toggling the wait mode but not the tag.

I would suggest code something like this:

Code:
script, restore battle wait mode, begin
  set battle wait mode(check tag(69))
end

script, toggle battle wait mode, begin
  set tag(69, not(check tag(69)))
  restore battle wait mode
end
Metal Slime
Send private message
 
 PostTue Feb 15, 2011 11:38 pm
Send private message Reply with quote
??? james, i'm not sure what you mean. the load game script is only meant to check whether the player had previously set the battle mode prior to exiting the game, then change it accordingly. it does not affect the tags whatsoever. (unless tag definitions are wiped when the game is exited? but then, MOST of the scripts and npcs wouldn't work because of this...)
Liquid Metal King Slime
Send private message
 
 PostWed Feb 16, 2011 1:21 am
Send private message Reply with quote
mjohnson092088 wrote:
??? james, i'm not sure what you mean. the load game script is only meant to check whether the player had previously set the battle mode prior to exiting the game, then change it accordingly. it does not affect the tags whatsoever. (unless tag definitions are wiped when the game is exited? but then, MOST of the scripts and npcs wouldn't work because of this...)


Yes, tags persist in saves

I think I phrased what I was trying to say badly.

Code:

if (check tag(69)) then, begin
  set battle wait mode (off)
end, else, begin
  set battle wait mode (on)
end


the off and the on are backwards in your "load game" script. so the tag is on but the wait mode is off, and vice versa.
Metal Slime
Send private message
 
 PostWed Feb 16, 2011 3:26 am
Send private message Reply with quote
wow. once again, do i feel stupid. it didn't seem to me that they were flip-flopped. i copy and pasted that part of the script so they would be, or at least i thought they would be, the same, and therefore, would change appropriately. i actually had the idea to change this before... but then i didn't for that very reason. now THAT works, and once again, i owe you for my own short-sightedness. lol thanks james.
Liquid Metal King Slime
Send private message
 
 PostWed Feb 16, 2011 3:59 am
Send private message Reply with quote
No worries. I do the same kind of thing all the time. check out my last two commits to the OHR source code :)
Metal Slime
Send private message
 
 PostWed Feb 16, 2011 4:20 am
Send private message Reply with quote
lol well, i'm glad that even the great james paige makes the simplest of mistakes. that makes me feel much better about all the stupid things i've done. but, they don't matter... as long as they eventually get fixed. anyway, this is still early on in the development of my game (still only about 4 hours of gameplay). needless to say, there will be more stupid mistakes to be made! and i will post them here, feel dumb, then fix them! and maybe one day, this project will be finished. but for now, you have not heard the last of me...! mwahahahaha! Kamina

oh, quick question: in the shop menu, if an item is set with a buy require tag, does the item still appear? and you're just not able to buy it? because i was using a "shop" for my alchemy system... but i don't want items to appear if you don't have the recipe for them. i was wondering if i was better off creating an alchemy system with their own menus, instead of using a shop menu for this. i'm gonna take a guess and say i should go for it.
Metal Slime
Send private message
 
 PostWed Feb 16, 2011 2:43 pm
Send private message Reply with quote
oh, and i fixed the problem with the text box not showing up when the player loads the game. it turns out that a menu item is unable to call the save menu (or any other kind of menu, probably) AND set a tag at the same time. the script was working correctly, but selecting the save option from the sanctuary menu brings up the save menu and does NOT set the tag. so, instead of having the menu call the save menu directly, i created a short script to call the save menu and set the tag. i'm not sure if this was intentional, but it might be worth looking into.
Liquid Metal King Slime
Send private message
 
 PostWed Feb 16, 2011 4:55 pm
Send private message Reply with quote
mjohnson092088 wrote:
oh, and i fixed the problem with the text box not showing up when the player loads the game. it turns out that a menu item is unable to call the save menu (or any other kind of menu, probably) AND set a tag at the same time. the script was working correctly, but selecting the save option from the sanctuary menu brings up the save menu and does NOT set the tag. so, instead of having the menu call the save menu directly, i created a short script to call the save menu and set the tag. i'm not sure if this was intentional, but it might be worth looking into.


This definitely sounds like a bug.

... actually, I am willing to be this only affects the "save" menu. Thw way menu items work, is the menu action happens first, and then after that the tag gets set.

This means that if you save your game, the tag doesn't get set until AFTER the game is saved.

Could you double check for me and see if tag setting works for other types of special menus? The approach i have to take to fix this could be a lot different if this is save-only problem instead of a problem with all special menu items.
Metal Slime
Send private message
 
 PostWed Feb 16, 2011 5:28 pm
Send private message Reply with quote
i ran a test by adding a "world map" option to the sanctuary, with a tag set when the menu item is used. i placed an npc that says "check the tag" before the tag is set, and "the tag is checked and set to on" if the tag was set. after using the test menu item from the sanctuary, the npc did indeed say "the tag is checked and set to on". perhaps it might be a good idea to allow tags to be changed before the menu item's action takes place? that way, at least as far as "save" goes, the tag change will be saved with the players game.
Metal Slime
Send private message
 
 PostWed Feb 23, 2011 9:09 pm
Send private message Reply with quote
i started on a new project, one that is a different type of game. i'm trying to make an action/adventure game, and am currently trying to create a HUD using slices and/or strings. i can make the HUD appear, but i seem to be lost as to how i'm supposed to make values appear. this is what i have so far:

Code:
plotscript, new game, begin
carlhealth := 100
carlmagic := 100
???
show string at (1,60,10) <=supposed to display current health
show string at (2,60,20) <=supposed to display current magic
load slice collection (0)
end


these are the globals i'm using:

global variable (1,carlhealth)
global variable (2,carlmagic)

i want to make the health/magic values appear at x60, y10/20 respectively. i realize that the string commands are being used wrong. i want to set the strings with the value of the globals and make them appear in the HUD, but i'm not quite sure how to go about doing that.
Liquid Metal King Slime
Send private message
 
 PostWed Feb 23, 2011 9:46 pm
Send private message Reply with quote
If you are using a slice collection I would not bother using the "show string at" commands at all.

Make sure your hud slice collection has two text slices. give one of them a Slice Lookup Code "health" and give the other a Slice Lookup Code "magic"

Code:

include, plotscr.hsd
include, mygame.hsi

global variable (1,health)
global variable (2,magic)
global variable (100, hud)

plotscript, new game, begin
  health := 100
  magic := 100
  hud := load slice collection (0)
end

plotscript, display health and magic, begin
  variable(sl)
  show value in text slice(health, sli:health)
  show value in text slice(magic, sli:magic)
end

script, show value in text slice, val, lookup code, begin
  variable(sl)
  sl := lookup slice(lookup code, hud)
  # use string 0 temporarily
  $0=""
  append number(0, val)
  set slice text(sl, 0)
end

Metal Slime
Send private message
 
 PostWed Feb 23, 2011 10:52 pm
Send private message Reply with quote
i'm getting errors up the yin-yang here. doesn't help that this is the first time i've tried to use slices and have no clue what i'm looking at, either. the error says that "set slice text" has an invalid slice handle, 0. what does that mean exactly? this is how i changed what you wrote to fit the actual game:

Code:
plotscript, new game, begin
  carlhealth := 100
  carlmagic := 100
  hud := load slice collection (0)
end

plotscript, display health and magic, begin
  variable(sl)
  show value in text slice(carlhealth, sli:carlhealth)
  show value in text slice(carlmagic, sli:carlmagic)
end

script, show value in text slice, val, lookup code, begin
  variable(sl)
  sl := lookup slice(carlhealth, hud)
  $0="100"
  append number(0, val)
  set slice text(sl, 0)
end


there are two characters, so i changed the variables and slices to be more specific.
Display posts from previous:
Page «  1, 2, 3, 4, 5, 6  »