Teeny Tiny Bad Guys
by Simon Fraser University (#0025) · in Technical Issues · 12/04/2007 (12:09 pm) · 4 replies
Hi all! I have a few types of AI behvaing relatively well in my game.
The problem is this: I scale the AImarkers using the Inspector (I definiately hit APPLY!) to make the bad guys the size I want, which works out during that mission. When I exit and go back to that mission, everything is saved EXCEPT their scale, so they are all mini!
Its kinda fun for the moment, but overall just will not do. I couldn't find where in the scripts I could make this scale change permanent, any suggestions? (Hopefully the suggestion will not be 're-export bigger models, our animator is out of town now and we're getting close to deadline!)
Thank you!
The problem is this: I scale the AImarkers using the Inspector (I definiately hit APPLY!) to make the bad guys the size I want, which works out during that mission. When I exit and go back to that mission, everything is saved EXCEPT their scale, so they are all mini!
Its kinda fun for the moment, but overall just will not do. I couldn't find where in the scripts I could make this scale change permanent, any suggestions? (Hopefully the suggestion will not be 're-export bigger models, our animator is out of town now and we're getting close to deadline!)
Thank you!
About the author
#2
%AI.setPosition(%marker.getPosition());
of course the two variable %AI and %marker may have different names. Then put.
%AI.setScale(%marker.getScale());
and change %AI and %marker to what their actual names are.
If you have any questions ask here, or send me an email to TrebConnell@gmail.com or mastertreb@gmail.com. I am a bit busy but this shouldn't take that long.
12/04/2007 (2:56 pm)
The AI only use only the markers location, not size as well. This can be changed of course. I would have to see your AI code to know where exactly to put the change, but if you find the line where it sets there position from the marker, which should look like %AI.setPosition(%marker.getPosition());
of course the two variable %AI and %marker may have different names. Then put.
%AI.setScale(%marker.getScale());
and change %AI and %marker to what their actual names are.
If you have any questions ask here, or send me an email to TrebConnell@gmail.com or mastertreb@gmail.com. I am a bit busy but this shouldn't take that long.
#3
in aiguard.cs find
if you aren't using AIGuard and you are having trouble figuring it out ask me and I'll take a look at your code if you want.
Also I am actually somewhat surprised that the line you are puting my code under isn't setting the scale. Because of this I'm not sure 100% that my code will work. I think I tried to do this once with minimal luck. But if it doesn't work let me know and I'll try on my end.
12/04/2007 (3:09 pm)
Well I think I figured it out for AI guard if that is what you are using.in aiguard.cs find
%player.setTransform(%obj.gettransform());there are two versions of this line one for spawn and one for respawn, under BOTH of them put
%player.setScale(%obj.getScale());
if you aren't using AIGuard and you are having trouble figuring it out ask me and I'll take a look at your code if you want.
Also I am actually somewhat surprised that the line you are puting my code under isn't setting the scale. Because of this I'm not sure 100% that my code will work. I think I tried to do this once with minimal luck. But if it doesn't work let me know and I'll try on my end.
#4
scale = "7 7 7";
inside
function AIPlayer::spawn3(%name, %obj)
Thanks for the input!
12/04/2007 (4:29 pm)
Thanks guys! Got it working now, turns out we just had to addscale = "7 7 7";
inside
function AIPlayer::spawn3(%name, %obj)
Thanks for the input!
Torque Owner Simon Fraser University (#0025)
I changed all the instances to have the right scale, but they still show up as tiny, and the scale still says scale 1 1 1 in the inspector (not 7 7 7, which is what the script says)
Still confused!