Author Topic: Battle Wounds logic problem/help  (Read 4819 times)

0 Members and 1 Guest are viewing this topic.

Joey

  • Guest
Battle Wounds logic problem/help
« on: July 18, 2003, 06:51:15 PM »
i was working on battle wounds today. i finished the intro. now i want to test out the battle system.

can someone tell me all the steps i need to do to set a certain key to so an action when i press it? i wanted to do insert, so this is what i did.

i set the number it is in the key logic one to c30.

i went into the battle system logic (logic 200) and made it so
if(c30){
 do this

is this set up the right way? i want it to do an animation, and subtract like 2 from variable 50. variable 50 is this tests guys health, which is at 6 right now. i press the insert key, and nothing happens  :(. how do i set a key to do something?



Offline Eigen

Re:Battle Wounds logic problem/help
« Reply #1 on: July 19, 2003, 02:32:24 AM »
First go to logic 91. There add    set.key(0,82,c35);     for example. Now go to your logic 200 and put      
  if(controller(c35)){
  v60 -= 1;


That should do it.



-Eigen
Artificial Intelligence Competition

Joey

  • Guest
Re:Battle Wounds logic problem/help
« Reply #2 on: July 21, 2003, 09:13:46 PM »
i think thats what i did, but ill try. thanks eigen.

Joey

  • Guest
Re:Battle Wounds logic problem/help
« Reply #3 on: July 22, 2003, 02:17:24 PM »
ok another problem :-[. now when i press the insert key, it only does one cel. then i press it again, and it does the next cel. i used the end.of.loop command at the end of the statement thing, and it doesnt work. i have to press insert for each cel. heres how i have the code.

if(controller(c35)) { (or something like that)
erase(o0);

animate.obj(o0);
load.view(2);
set.view(o0,2);
position(o0,90,88);
draw(o0);
end.of.loop(o0,f16);
}
else {
print("error.");
}
}

i have it something like that. i have the stop.motion(o0); at the top of the file, so that i cant move around, or something like that. am i missing a statement? whats wrong? if you need to, i could send the logic file i guess.

Offline Eigen

Re:Battle Wounds logic problem/help
« Reply #4 on: July 23, 2003, 01:45:23 AM »
Maybe try using   start.cycling(o0);  before   end.of.loop   comand  and try putting the animate.obj  comand after    set.view(o0,2);



-Eigen
Artificial Intelligence Competition

Joey

  • Guest
Re:Battle Wounds logic problem/help
« Reply #5 on: July 23, 2003, 03:21:59 PM »
ill give it a shot

Offline Andrew_Baker

Re:Battle Wounds logic problem/help
« Reply #6 on: July 23, 2003, 09:30:43 PM »
Whoa, whoa, whoa, young man.  Why do you have the code to initialize the object in a conditional block?  Wouldn't it be a bit safer in the head of the room logic (ie, within if (new_room) { })?  Then, you could make all of the actions on it within the conditional block.

Are you temporarily replacing the ego with a different animated object?  If so, I can totally understand.  Did it the same way meself.
I hope you realize that one day I will devour the Earth.

Joey

  • Guest
Re:Battle Wounds logic problem/help
« Reply #7 on: July 24, 2003, 08:05:25 AM »
what im doing, is when you get into a fight, it goes to logic 200 which has its own picture, and loads the character you ran into from a flag, and changes your ego to the view of you with a sword out. i dont really understand what you mean though. do you mean put it at the top, before show.pic() ?

Offline Andrew_Baker

Re:Battle Wounds logic problem/help
« Reply #8 on: July 25, 2003, 12:31:25 AM »
Yes.

Otherwise, when the flag is true, then it is reinitializing that image...  which you don't really want.  I don't know if that is your bug, but is a simple enough optimization that should reduce some overhead.  If you need multiple different animations, you can put them all in loops within the same view.
I hope you realize that one day I will devour the Earth.

Joey

  • Guest
Re:Battle Wounds logic problem/help
« Reply #9 on: July 25, 2003, 08:22:23 AM »
i just need loop 0 to cycle through until the end, then go back to cel 0 of it and wait. then once i press insert again, it will cycle the cels until the end of loop, then go back.

Offline Andrew_Baker

Re:Battle Wounds logic problem/help
« Reply #10 on: July 27, 2003, 02:56:14 AM »
But what I'm trying to tell you is that the best place for

animate.obj(o0);
load.view(2);
set.view(o0,2);
position(o0,90,88);
draw(o0);

is like this:

if (new_room) {

//some other code here

animate.obj(o0);
load.view(2);
set.view(o0,2);
position(o0,90,88);
draw(o0);

}


In fact, when I look at your code again...  you should never have to use the command, animate.obj(o0).  The ego is automatically animated, isn't it?

Either way, try using something more like this


if (new_room) { //Initialize a brand new object to replace the ego temporarily.
                         //The ego doesn't like using a lot of the normal animation
                         //functions, in my experience.

//some other code here

animate.obj(o1);
load.view(2);
set.view(o1,2);
position(o1,90,88);
draw(o1);
}

if(controller(c35) || f16) {  //Press TAB to run loop, not sure whether it should
                                         //be f16 or !f16
program.control(); //keep the ego from moving
erase(o0);
end.of.loop(o0,f16);
}
//you were using an extra } here, and you don't need that error message here

if (f16) { //Not sure whether it should be f16 or !f16
              //but this block should be called when the end.of.loop() ends

erase(o1);
draw(o0);
player.control();
}

This is a bit crude, and it won't solve all of your problems, but it should be a step in the right direction.  Remember that you should keep graphic initializations in the header, and that you should never have to reinitialize the ego object.
I hope you realize that one day I will devour the Earth.

Kon-Tiki

  • Guest
Re:Battle Wounds logic problem/help
« Reply #11 on: July 27, 2003, 01:34:44 PM »
Joey: one good tip. Look at my FF Battle System. I'm not telling you to use it, but it shows all those things.

If you don't want to wrestle your way through the code, I'm going to make a tutorial for that one of these days. Reading that'll explain those problems step by step too ;)

-Kon-Tiki-

Joey

  • Guest
Re:Battle Wounds logic problem/help
« Reply #12 on: July 28, 2003, 06:13:56 PM »
Kon, mines different then yours though. Ill still take a look at it, but mine is gonna be different than yours.

Kon-Tiki

  • Guest
Re:Battle Wounds logic problem/help
« Reply #13 on: July 29, 2003, 06:09:40 AM »
I know, but certain aspects come back in every single kind of battle system, like key input, responding to certain inputs, etc. You can get those out of my battle system. It'll save you alot of headaches and posts.

-Kon-Tiki-

Offline Andrew_Baker

Re:Battle Wounds logic problem/help
« Reply #14 on: July 31, 2003, 12:45:37 AM »
Also, check out the VG final battle with the Dream King for what your code should NOT look like :D
I hope you realize that one day I will devour the Earth.


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

Page created in 0.031 seconds with 17 queries.