dMZX Forums: I made a whatsit. - dMZX Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

I made a whatsit. Really. I did.

#1 User is offline   astral 

  • 6 pc chicken mcnobody
  • PipPipPip
  • Group: Members
  • Posts: 475
  • Joined: 20-October 01
  • Gender:Male
  • Location:South Carolina

Post icon  Posted 10 April 2002 - 01:59 AM

I revamped an old RPG core that I'd made about 3-4 weeks ago, and it's pretty nifty, I'll try to upload it soon. It's basically the underlying structure to pen and paper RPGs, or roguelikes like ADOM. It encompasses a load of weapons, spell classes, and it uses the x-y+z format, which is essentially the XdYs+Z thing. It worked perfectly fine until I went back and did another revamp, and then it stopped working. I opened the robot up and searched and searched for what could be wrong.

The problem I'm encountering, is that the robot won't reset the result counter to zero after it finishes rolling. The code is set up to empty it out when it begins a new roll, so that it'll return the result the same until you begin a new roll, (Duhrr) This is an example of the code, in a second I"ll give you the problem:

end
:skill_dagger
set "d_two" "s_dagger"
set "s_two" "s_dagger"
goto "use_str"
...
:use_str
set "d_one" "str"
set "s_one" "str"
goto "beginroll"
...
:beginroll
set "result" 0
divide "d_two" 100
divide "s_two" 10
divide "d_one" 100
divide "s_one" 100
inc "d_one" "d_two"
inc "s_one" "s_two"
set "std_d" "d_one"
:roll
if "d_one" = 0 "finish"
set "loopcount" random "std_d" through "s_one"
inc "result" "loopcount"
dec "d_one" 1
goto "roll"
:finish
set "d_one" 0
set "d_two" 0
set "s_one" 0
set "s_two" 0
set "loopcount" 0
end


And it just progressively adds to the result counter, never clearing it. So you get things like:

Rolled 9
Rolled 254
Rolled 456
Rolled 1024
Rolled 1333

And I can't figure it out. HHHHHHEEEEELLLLLLPPPPP
i thought you said weast
0

#2 User is offline   Frobozz 

  • Ryiah
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,808
  • Joined: 07-March 01
  • Gender:Not Telling

Posted 10 April 2002 - 07:47 AM

I'm not sure if this will do anything, but put in SET "result" to 0 under the FINISH label.
0

#3 User is offline   astral 

  • 6 pc chicken mcnobody
  • PipPipPip
  • Group: Members
  • Posts: 475
  • Joined: 20-October 01
  • Gender:Male
  • Location:South Carolina

Posted 11 April 2002 - 01:08 AM

You can't, because then the robot requiring the roll wouldn't be able to get the result before it cleared.
i thought you said weast
0

#4 User is offline   weasel 

  • bleh
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 7,915
  • Joined: 23-December 00
  • Gender:Male
  • Location:Hillsboro, Oregon

Posted 14 April 2002 - 12:20 AM

Make it WAIT 1 before it clears the counter. I had that problem with SCUMZX because it kept messing up the items menu.
Blaugh!
Serious damage to important body parts pretty much ruins any plans you had for living. Bummer.
0

#5 User is offline   astral 

  • 6 pc chicken mcnobody
  • PipPipPip
  • Group: Members
  • Posts: 475
  • Joined: 20-October 01
  • Gender:Male
  • Location:South Carolina

Posted 14 April 2002 - 01:46 AM

It's fine now, I scrapped the code and rewrote it. So.. yeah. ALthough, I wonder why it wouldn't reset the counter when it was sposed to? That's sort of weird.
i thought you said weast
0

#6 User is offline   Revvy 

  • Jeez guys, there's no need to be narky.
  • PipPipPipPipPipPip
  • Group: Members
  • Posts: 3,520
  • Joined: 05-March 01
  • Gender:Male
  • Location:Ontario, Canada

Posted 15 April 2002 - 06:56 PM

I've had a few problems with code too.  I change the viewport size then I scrollview position and it scrolls to te wrong place.  I think it's a problem with mzx.
<+AFK> Bringing whisky to my mother is like irrigating a lake.

<+AFK> dormando's apathy is palpable.
* AFK palpates
<dormando> stop that

<Malwyn> undressing with revvy a little over a metre away. new definition of awkward.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users