Author Topic: New Problem  (Read 1633 times)

0 Members and 1 Guest are viewing this topic.

Offline Corby

New Problem
« on: April 28, 2003, 07:42:39 PM »
Hi, I have my ego walk over a control line, which triggers f3 and causes the ego's view to change to that of running.  How can I return the ego back to normal if it walks over the same control line for a second time?



Offline robingravel

Re:New Problem
« Reply #1 on: April 28, 2003, 09:04:00 PM »
Let me see...

if (isset(f3)){
 if (!isset(f100)){
  set(f100);
  .....
 }
 else{
  reset(f100);
 }
}



Robin Gravel

Offline Corby

Re:New Problem
« Reply #2 on: April 30, 2003, 03:21:52 AM »
Still can't get this working...  what's with the ! in (!isset) Robin?? I think I just may need this explained to be verbally rather than in code. Thanks :)

Offline Andrew_Baker

Re:New Problem
« Reply #3 on: April 30, 2003, 03:30:02 AM »
Imagine that you have a flag (which you do).  It is either running or walking.  If your character touches the priority line, then it should swap between them, right?  However, you should probably jimmy some code to make sure that it doesn't constantly flip between the two states...  in pseudo code, it might be something like,

if (touching_line) {
    if (!locked) {  // ! means NOT
    toggle.flag(running);
    set(locked);
    }
   }
else {
   reset(locked);
   }

Something like that.  It uses two flags (one to change the state and the other to keep your ego from switching back and forth).  Unfortunately, it's been so long since I've used AGIStudio that I've forgotten the proper function calls.
I hope you realize that one day I will devour the Earth.

Offline Sami Tervo

Re:New Problem
« Reply #4 on: April 30, 2003, 04:06:12 AM »
Hehehehe >:)

* Grabs flags and burns them! *

Here's a almost flag-free way: This method is based on direction of ego (v6). Checkout help-file for further information of directions (e.g. getdir)

if(f3){ // Ego hittin Signal Line
 if(v6 == 7){ // Ego coming from left
   set.view.v(v16,runninview);
   force.update(o0);// Optional, if you don't want to wait for next loop
 }
 if(v6 == 3){ // Ego coming from right
   set.view.v(v16,walkinview);
   force.update(o0);
 }
}

7 & 3 ain't sure..don't remember those right now..like I said, check out that help-file. You probably have to add more directions like coming from up-right, down-left and so on...hopefully you get the picture.

And this is good only for straight signallines..
Apocalyptic Quest [ http://apocalypticquest.cjb.net ] No Mutants Allowed [ http://www.nma-fallout.com ] Batmud [ http://www.bat.org ]

Offline Corby

Re:New Problem
« Reply #5 on: April 30, 2003, 08:17:38 PM »
Great, everything's working fine, thanks!


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

Page created in 0.053 seconds with 22 queries.