Author Topic: Character scaling using script  (Read 330 times)  Share 

MurrayL

    • I can help with AGS tutoring
    •  
    • I can help with backgrounds
    •  
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Character scaling using script
« on: 15 Aug 2012, 19:13 »
I have a room in which there are no walkable areas, but I need to scale a character sprite. In other rooms, I've been able to use the built-in walkable area scaling property to set scaling factors of, for instance, 500%. Unfortunately, it seems that the Character.Scaling property is limited to a maximum of 200.

I was hoping someone could let me know if there's any reason for this limit, and if there's a way around it?

Thanks in advance!

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Character scaling using script
« Reply #1 on: 15 Aug 2012, 20:27 »
I guess the reason is that the sprite starts to look really ugly at zoom levels above 200%...?
It's curious though that the room editor allows numbers much higher than 200.

Anyway, the first thing that comes to mind is using a walkable area. Is there any reason why you aren't using one? If you don't want the character to be able to walk, there's other ways of achieving that.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

MurrayL

    • I can help with AGS tutoring
    •  
    • I can help with backgrounds
    •  
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: Character scaling using script
« Reply #2 on: 17 Aug 2012, 16:37 »
I don't suppose we could have this limit removed in future versions of AGS? It seems entirely arbitrary!

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Character scaling using script
« Reply #3 on: 17 Aug 2012, 16:59 »
Again, I don't think it's arbitrary. One does not simply zoom stuff up to 500%, one (re)draws stuff at that size / draws stuff at the max needed size and scales down.
Since you didn't answer my question: why aren't you using a walkable area?
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

MurrayL

    • I can help with AGS tutoring
    •  
    • I can help with backgrounds
    •  
    • I can help with play testing
    •  
    • I can help with proof reading
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: Character scaling using script
« Reply #4 on: 17 Aug 2012, 17:35 »
Sorry Khris - I didn't mean to ignore the question! :) I only meant the limit seems arbitrary because it clearly isn't applied when using walkable area scaling in the editor properties panel.

At the moment I'm preventing the player from moving manually in the scene by disabling the walkable areas (and re-enabling them when they're needed).

Code: Adventure Game Studio
  1. RestoreWalkableArea(1);
  2. cPilot.Walk(260, 305, eBlock);
  3. RemoveWalkableArea(1);

Is there a different way of preventing Walk To commands from working? I can't just disable the eModeWalkTo mouse mode, since it's the only cursor mode my game uses (it runs Look/Interact when over an object and Walk To otherwise).
« Last Edit: 17 Aug 2012, 17:38 by MurrayL »

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Character scaling using script
« Reply #5 on: 17 Aug 2012, 20:32 »
You can intercept clicks by adding an on_mouse_click function to the room script:

Code: Adventure Game Studio
  1. function on_mouse_click(MouseButton button) {
  2.   if (no_manual_walk && button == eMouseLeft && mouse.Mode == eModeWalkto) ClaimEvent();
  3. }
ClaimEvent() prevents the global on_mouse_click from being run afterwards.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"