independent character shadows [SOLVED]

Started by don_tomaso, Wed 26/01/2005 00:57:15

Previous topic - Next topic

don_tomaso

ive used ags for about 6 months but I never used scripting very much so my question is:

if I want to make a shadow for my character (like another character that is following my character instantly all the time) how should I script it?

Ive tried using the command "character - follow another character" but there is a delay on the movement of the shadow, so how do I make it follow my character instantly? and how do I make it so that it is always behind my character?

if there is an easier way of making shadows, please feel free to tell me..


ive searched the forums for shadows but i didnt find anything useful

Gilbert

I think the interaction responses are limited, you may need to use the text scripting function FollowCharacterEx() and set the DIST parameter to FOLLOW_EXACTLY instead.

don_tomaso

#2
so if I were to script that the script would look like this?

FollowCharacterEx (SHADOW, PLAYER, FOLLOW_EXACTLY)



edit: got it working now, but is there a way to make it appear behind the player character?

Goot

In function Game_Start(){ in the global script, type this script:
SetCharacterBaseline(SHADOW,player.y-1);

don_tomaso

hm got an "parse error" .. what does that mean? Im really no good at scripting

this is what it looks like
"function game_start(SetCharacterBaseline (SHADOW,player.y-1);) {"

strazer

It has to look like this

Code: ags

function game_start() {
  SetCharacterBaseline(SHADOW, player.y-1);
}


I think Goot wants to make sure the shadow is always drawn behind the player character. I don't think it will work this way since the baseline isn't updated when the player character moves.
The front/behind drawing can be controlled using the FollowCharacterEx function directly. Just set the "eagerness" parameter to 1. Check the manual for FollowCharacterEx.

don_tomaso

oh thanx guys, got it working now.

also learned a bit bout scripting :D

SMF spam blocked by CleanTalk