Just use left and right sprites not up and down

Started by manny.p, Tue 14/06/2005 17:50:46

Previous topic - Next topic

manny.p

I want to use sonic the hedgehog sprites, but don't want to use up and down ones.

I want it so if he goes down and the direction he's going is left, that is displays the left loop, or if hes going up and rigt, it just displays the right loop.

I get errors when he goes directly up or down, can anyone help me with this without actually putting sprites in the loop but instead him using a left or right sprite?


manny.p

Thnx m8, that guys script worked perfectly (even though i don't know how to use scripts i figured it out).

Here's his script:
if ((GetCursorMode() == 0)&&(button==LEFT))  {
    if (mouse.x>character[EGO].x){
      SetCharacterView(TIM, 3);
      MoveCharacter(TIM, mouse.x, mouse.y);
      }
    else {
      SetCharacterView(TIM, 6); 
      MoveCharacter(TIM, mouse.x, mouse.y);
      }
    }

Gilbert

Actually since V2.6 of AGS:
Quote
- Added ability to have only left/right walking frames for
   characters (just delete all frames in loop 0).

You don't actually need any scriptings to disable the up/down loops.

ilSilente

#4
WHAT? I'm quite sure it didn't work with AGS2.6 O_o O_o
Anyway, it works fine with 2.7 :D

--edit--
It works but when I open the "Characters" section in AGSEdit, an error message says: "The editor attemped to display sprite -1" etc etc. And it's right because loop 0 is empty; anyway the editor should prevent this error displaying the first frame of loop 1 (in fact, the editor just hang up now). :-\

manny.p

He's right it doesn't work in ags 2.6, i always get that error, "cannot find loop 0 in view x".

I thought ags 2.6 was the latest one out, better go download me a new copy.

manny.p

I get all these errors when going up and down, andthere are no fames in loop 0, just  loop1 + 2, can't they get this one thing right. ::)

Gilbert

#7
What about V2.62?

It's not advisible to change to V2.7 if you had started your game already, since there're lots of changes in V2.7 that you may need some conversion for your files.

Edit:
I just create a test game with V2.6, I deleted all frames from loop0 of View1 and Roger walks without any problem for me, are you sure you're using the final version V2.6, not a beta version?

Go to the docs folder (if this folder doesn't exists it's definitely a beta version) and read changes.txt, find the section about V2.6, you shall find that quoted lines I posted earlier.

ilSilente

@Gil:
The game runs correctly, but the editor give me error when i select the character in the "characters" entry in the tree on the left.
I'm using AGS 2.70.601

Gilbert

#9
Odd, never crash for me using V2.7 or V2.62.
And right, V2.70.601 is already newest version (not coutning V2.71 betas).

maybe you can try zipping your game (no room file needed) and upload it so we can investigate on the problem.

Edit:Ah ha!
I had just checked, and I can now confirm that there're lots of crashes using this feature, I'll inform chris about this in the technical forum.

Okay, I think I found out the cause now.
The offending part is that if the option "Characters turn before moving" is checked the game will crash, so all you have to do is to disable that option.
However, since it's not very friendly and I'll consider it as a bug, I'll report it to Chris anyway.


EDIT:reported

manny.p

is there any way i can disable turning and the re-enable it in the script?

or for just one roomk disable it?

strazer

Check out the SetGameOption function (OPT_TURNBEFOREWALK) and the Character.TurnBeforeWalking property.

manny.p

Well i tried both, putting them in befoe fade in, and right before the walk function which it crashs on, no luck.

I even tried both together.

This is a bug they'll just have to fix

manny.p

Can anyone tell me where to put them functions, because this is really bugging the hell out of me.

Ashen

Which version are you using? (I know you where using 2.6, but have you updated yet?)
SetGameOption(OPT_TURNBEFOREWALK, 0); is for 2.62, and I think it affects all characters, while character[CHARID].TurnBeforeWalking = 0; is the 2.7 usage, and has to be set indicidually - could you be calling it for the wrong character?.

Either of those places should work. What exactly is the crash, and what are you doing/trying to do when it occurs?
I know what you're thinking ... Don't think that.

strazer

Quotecharacter[CHARID].TurnBeforeWalking = 0; is the 2.7 usage

Yes, in AGS v2.62 you have to use the SetCharacterProperty function to change it for specific characters.

manny.p

#16
What about turn when facing? << This was the real problem not turn while walking

SetGameOption (OPT_TURNWHENFACING, 0);


I've got the global function but don't know where to put it where it has effect?

SMF spam blocked by CleanTalk