If statements - if cursermode set view.

Started by Chicky, Tue 06/03/2007 13:23:59

Previous topic - Next topic

Chicky

Hello all,

I'm pants at this coding business and need a little help, i don't really understand if statements in ags but i need to have a piece of code where it sets a certain character view when a certain cursermode is selected.

something like this.. right?

if (mouse.Mode == eModeVine) return setcharacterview (EGO, 19) ;

And put it in the global script?

i duno, any help is appreciated :)

Ashen

Where in the Global script have you tried this? What is/isn't doing that's not what you want?

I don't know what the return is doing in there (does SetCharacterView actually return anything anyway?) and you're mixing old and new coding, which is never a good idea (the old SetCharacterView and the new mouse.Mode). And, of course, you'll probably need something to change BACK from that view when mouse.Mode != eModeVine.

What about (Untested, and assuming eModeVine is a valid cursor mode...):
Code: ags

// in repeatedly_execute
if (mouse.Mode == eModeVine) {
   if (cEgo.NormalView != 19) cEgo.ChangeView(19);
}
else { // i.e. Not eModeVine
  if (cEgo.NormalView != EGONORMAL) cEgo.ChangeView(EGONORMAL);
  // Where EGONORMAL is the number of Ego's usual non-vine view, obviously
}


ChangeView changes the normal walking view for real. The actual equivalant of SetCharacterView is LockView. ChangeView made more sense to me, but change it out with Lock/UnlockView if you need to. Of course, it might help to know a bit more about what you want to do, but that SHOULD work
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk