Author Topic: lil' puzzle for ya  (Read 1842 times)

0 Members and 1 Guest are viewing this topic.

Offline Sami Tervo

lil' puzzle for ya
« on: April 11, 2002, 01:22:00 AM »
in my project there is a little problem in combat walking system (= the range you can walk is defined by action points you have).

at first time when i programmed that, it went quite good. when player wanted to go to place B, i subtracted amount of required action points of current action points. although there was a problem. if player hits to other object or block of somekind, he stops but he "lost" some action points coz he didnt managed to travel distance he planned. and subtracting action points after he has reached the destination, offered many ways to cheat.

so i tried to program system which subtracts little bit action points in every cycle and it failed. i uploaded that to net if someone of you could take a look and tell how solve the problem.

combat walking-code is in logic.123

DOS-Version
http://koti.mbnet.fi/sterv/aqd.zip
WIN-Version
http://koti.mbnet.fi/sterv/aqw.zip

please help!


Apocalyptic Quest [ http://apocalypticquest.cjb.net ] No Mutants Allowed [ http://www.nma-fallout.com ] Batmud [ http://www.bat.org ]

Offline Andrew_Baker

Re:lil' puzzle for ya
« Reply #1 on: April 11, 2002, 05:48:04 PM »
What I had in mind was more of a step-by-step AP subtraction with the keypad.

if(isset(f60)){ // If movement flag is on
 get.posn(o0,v40,v41);
 if ((new_ego_x>v40 ||
      new_ego_x<v40 ||
      new_ego_y>v41 ||
      new_ego_y<v41)){
      AP-=1;
      }
}

Unfortunately, I have no idea if this will work or not, because I can't figure out what variable you are using for AP, and command-line input won't work.
I hope you realize that one day I will devour the Earth.

Offline Sami Tervo

Re:lil' puzzle for ya
« Reply #2 on: April 12, 2002, 12:15:28 AM »
strange..command line input should work..well ap-variable (191) and other stuff are found from logic.000 start
Apocalyptic Quest [ http://apocalypticquest.cjb.net ] No Mutants Allowed [ http://www.nma-fallout.com ] Batmud [ http://www.bat.org ]

Offline Andrew_Baker

Re:lil' puzzle for ya
« Reply #3 on: April 12, 2002, 12:46:19 AM »
This is what I have so far.  I'm missing something, I know, Sami.  Could you please supply a defines.txt that names all the variables you're using.  It would be a big help.  I'm going to try something similar, but simpler in a game I plan on working on next, so I have an active interest in seeing this code worked out.

#include "defines.txt"

if(isset(f99)){ // Double click with one click-disabler
 v66+=1;
 if(v66==2){
   reset(f99);
 }
}


if(isset(f60)){ // If movement flag is on
 get.posn(o0,v40,v41);
 if ((new_ego_x>v40 ||
      new_ego_x<v40 ||
      new_ego_y>v41 ||
      new_ego_y<v41)){
      v191-=1;
      }
}

if(mouse_y < 147) {
 // Walk-AP-Cost-Show-Code
 if(mouse_button == 0 && isset(f50) && isset(f41) && !isset(f60)) {
     v29 -= 8;
     reposition.to.v(o10,v28,v29);
     distance(o0,o10,v193);
     reposition.to(o10,1,1);
     set.text.attribute(0,0);
     display(19,37,"  ");
     if(v191 >= v193){
       set.text.attribute(15,0);
       display(19,37,"%v193");
     }
     else{
       set.text.attribute(15,0);
       display(19,37,"-");
     }

 }
 // Movement
 if(mouse_button == 1 && isset(f50) && isset(f41) && !isset(f60) && !isset(f99)) {
     v29 -= 8;
     reposition.to.v(o10,v28,v29);
     distance(o0,o10,v193);
     reposition.to(o10,1,1);
     set.text.attribute(0,0);
     display(19,37,"  ");
     if(v191 >= v193){
       v62=v193;
       set(f99);
       set(f60);
       v63=v28;
       v64=v29;
       set.text.attribute(15,0);
       display(19,37,"%v193");
       move.obj.v(o0, v28, v29, 2, f255);
     }
     else{
       set.text.attribute(15,0);
       display(19,37,"-");
     }

 }

}

return();
I hope you realize that one day I will devour the Earth.

Offline Sami Tervo

Re:lil' puzzle for ya
« Reply #4 on: April 12, 2002, 04:00:05 AM »
 :P okie...i defined variables, objects and flags for logic.123...get it from :
http://koti.mbnet.fi/sterv/defines.txt

Apocalyptic Quest [ http://apocalypticquest.cjb.net ] No Mutants Allowed [ http://www.nma-fallout.com ] Batmud [ http://www.bat.org ]


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.063 seconds with 20 queries.