awesome idea On Wed, May 19, 2010 at 12:46 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote: > you may be wondering how we are going to re-use this for future levels when > we have less or more troll huts. > > what i would do if you dont have a solution for that would be to name them > this way... > > TrollHut1 > TrollHut2 > TrollHut3 > ... > etc > > and then, in the script for the level, basically have a while loop (pseudo > code) > > Index = 1; > NickName = "TrollHut"+Index; > ModelID = Model_GetByNickName(NickName); > > while ModelID != -1 do > > --spawn a mob at ModelID's location > > Index = Index + 1; > > NickName = "TrollHut"+Index; > ModelID = Model_GetByNickName(NickName); > > end > > so that way, as long as people follow the naming convention when building > the maps, it will be able to "autodetect" troll huts. > > > On Wed, May 19, 2010 at 12:41 PM, Kent Petersen <kentkmp@xxxxxxxxx> wrote: > >> I'll look into that. Seems like a better way of doing it. >> >> On Wed, May 19, 2010 at 12:39 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx>wrote: >> >>> Yes (: >>> >>> In the editor when you have the model properties window open, theres a >>> place for a "NickName" >>> >>> you just put a string of text in there... aka "TrollHut1". >>> >>> Then from script you can do a Model_GetByNickName or something like >>> that. I forget what the function is called exactly but it should be >>> obvious... or i think the level 1 overworld's index.lua script has an >>> example of that to get the terrain model. >>> >>> Anyhow, from there you can get the model's position (and rotation if you >>> care) and you should be able to spawn a mob of type "troll hut" at that >>> location. >>> >>> the troll hut mob would then not have to load any model as part of it's >>> script... it would just worry about creating guys. >>> >>> it should all be possible (: >>> >>> >>> On Wed, May 19, 2010 at 12:35 PM, Kent Petersen <kentkmp@xxxxxxxxx>wrote: >>> >>>> Do we have functionality for that now? >>>> >>>> Would we be able to turn the model in the editor into a mob? >>>> >>>> >>>> On Wed, May 19, 2010 at 10:23 AM, Alan Wolfe <alan.wolfe@xxxxxxxxx>wrote: >>>> >>>>> Another idea that might be nice (maybe for later on though...) would be >>>>> to place a model of a troll hut in the world in the editor but give each a >>>>> nickname of like "TrollHut1" "TrollHut2" etc and then from script you can >>>>> get a model by it's nickname, then get it's position and rotation from the >>>>> model (Model_GetPosition etc) and spawn your "spawning mob" at the >>>>> location. >>>>> >>>>> That way you can place and manipulate troll huts in the editor, but >>>>> they are functional in game. >>>>> >>>>> >>>>> On Wed, May 19, 2010 at 10:06 AM, Kent Petersen <kentkmp@xxxxxxxxx>wrote: >>>>> >>>>>> Thanks man, I see what you mean. I like your suggestion >>>>>> >>>>>> >>>>>> On Tue, May 18, 2010 at 10:21 PM, Apache User < >>>>>> dhapache@xxxxxxxxxxxxxxxxxxx> wrote: >>>>>> >>>>>>> User:atrix256 >>>>>>> >>>>>>> Message: Hey Kent, this fixes the Model_SetOnWorld problem. >>>>>>> >>>>>>> (it uses that function to put the houses on the world for the town >>>>>>> buildings now) >>>>>>> >>>>>>> One problem though, you can't use model_setonworld until the first >>>>>>> Update happens (because the world isnt finished building until then), >>>>>>> so you >>>>>>> can't put it just out there in the file. >>>>>>> >>>>>>> What i would do is make a variable like "IsFirstUpdate" and i'd set >>>>>>> it to 1 or true, then in the Update function if that was true, id set >>>>>>> it to >>>>>>> false and do the set on world stuff. >>>>>>> >>>>>>> Either that or manually place those on the world where they should >>>>>>> be. >>>>>>> >>>>>>> <Files Changed> >>>>>>> U ActRaiser/ARRelease.exe >>>>>>> U ActRaiser/Scripts/GameOverworld/Town.lua >>>>>>> U Code/ARRelease.exe >>>>>>> U Code/AR_LuaFuncs.cpp >>>>>>> U PirateDice/ARRelease.exe >>>>>>> >>>>>>> >>>>>>> ============================== >>>>>>> Project 1 Dev mailing list >>>>>>> to unsubscribe, please send an email request to demofox@xxxxxxxxxxx >>>>>>> Project 1 website: http://project1.demofox.org >>>>>>> Project 1 SVN repository: http://pyotek.com/project1 >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> >