Page 1 of 1

Easter Egg Resurrection

Posted: 09 Mar 2007, 07:54
by trepan
Want to transform a tree into a maverick?

Spring.SetFeatureResurrect(featureID, "unitDefName"[, facing])
ex: Spring.SetFeatureResurrect(209, "armmav", 3)

It does give you a clue... the resurrection mouse cursor is displayed.

Here are some other items that are currently coded in LuaSyncedCtrl.cpp:

Code: Select all

    static int CreateUnit(lua_State* L);
    static int DestroyUnit(lua_State* L);
    static int TransferUnit(lua_State* L);

    static int CreateFeature(lua_State* L);
    static int DestroyFeature(lua_State* L);
    static int TransferFeature(lua_State* L);

    static int SetUnitTooltip(lua_State* L); // named units; Bob, Sheila, etc...
    static int SetUnitHealth(lua_State* L); 
    static int SetUnitMaxHealth(lua_State* L);
    static int SetUnitStockpile(lua_State* L);
    static int SetUnitExperience(lua_State* L);
    static int SetUnitPosition(lua_State* L);  
    static int SetUnitDirection(lua_State* L); 
    static int SetUnitStealth(lua_State* L);   
    static int SetUnitNoSelect(lua_State* L);  
    static int SetUnitNoMinimap(lua_State* L); 
    static int SetUnitAlwaysVisible(lua_State* L);

    static int SetFeatureHealth(lua_State* L);
    static int SetFeatureReclaim(lua_State* L);
    static int SetFeatureResurrect(lua_State* L);
    static int SetFeaturePosition(lua_State* L); 
    static int SetFeatureDirection(lua_State* L);

    static int LevelHeightMap(lua_State* L);
    static int AdjustHeightMap(lua_State* L);
    static int RevertHeightMap(lua_State* L);

    static int SendMessage(lua_State* L); 
    static int SendMessageToPlayer(lua_State* L);
    static int SendMessageToTeam(lua_State* L);
    static int SendMessageToAllyTeam(lua_State* L);
    static int SendMessageToSpectators(lua_State* L);

    static int CallCOBScript(lua_State* L); 
    static int CallCOBScriptCB(lua_State* L);
    static int GetCOBScriptID(lua_State* L);  
    static int GetHeadingFromVector(lua_State* L);
    static int GetVectorFromHeading(lua_State* L);
    
    static int GiveOrderToUnit(lua_State* L);  
    static int GiveOrderToUnitMap(lua_State* L);
    static int GiveOrderToUnitArray(lua_State* L);
    static int GiveOrderArrayToUnitMap(lua_State* L);
    static int GiveOrderArrayToUnitArray(lua_State* L);

    // LuaCob and LuaRules  (fullCtrl)
    static int EditUnitCmdDesc(lua_State* L);
    static int InsertUnitCmdDesc(lua_State* L);
    static int RemoveUnitCmdDesc(lua_State* L);
NOTE: The synced lua scripts do not have access to player names, so
messages must use the <PLAYER9> embedded syntax to print them.

Posted: 09 Mar 2007, 08:50
by Forboding Angel
I bow in your divine presence.... Basically...












HELL YEAH!!!!!

Posted: 09 Mar 2007, 16:31
by LOrDo
That would be SOOO cool for Single Player missions.

Posted: 09 Mar 2007, 17:04
by Peet
zomg treekrog ambush.

Posted: 09 Mar 2007, 22:41
by Sheekel
Would it be possible to base an entire mod on the premise of turing units into trees? You have to decide, do you burn all the trees up to prevent your opponent from getting trees (and lose them yourself), or do you use them to build a huge uber tree army!

We could model units with bark textures and branches for arms! Leaf Fight!

Posted: 11 Mar 2007, 00:38
by Argh
More to the point... is there a way to have a non-user-interferable way to transform all Trees to Features of a modder's choice... and even have this do this after getting the map's name, or a line added to the .SMD files for compatiblity?

Because what I really want, frankly, is a way to get rid of Spring's default trees, replacing them with random, higher-quality models, at the startup of a game. I was previously thinking that I'd have to re-write a part of the software needed to interpret Features, but if there's a fairly straightforwards backwards-compatible way to do this with LUAGUI code, I'm totally there.

I'd really like this as a Widget. If somebody wants to write one, I'll make some high-quality trees, in S3O format, with low polycount and low texture sizes, so that performance is only slightly impacted.

While I'm on this topic... can we someday get all Features not on the screen culled out of the rendering pipeline? That's what really drags down performance with maps that use a lot of Features. If this has already been done, I wasn't aware of it.

Posted: 11 Mar 2007, 00:42
by AF
Argh mapconv needs patching, not the engine.

Posted: 11 Mar 2007, 04:13
by Argh
I know, sorry, I mis-wrote that. Mapconv is setting the RENDERTYPE_TREE :P

Posted: 11 Mar 2007, 05:25
by trepan
Spring.GetFeaturesInRectangle() -- use full map size
Spring.GetFeaturePosition()
Spring.GetFeatureInfo()
Spring.DestroyFeature()
Spring.CreateFeature()

Should be enough to replace the trees with a LuaGaia script
(gaia can control the 'allyteam == -1' global features). This
probably isn't the best way to go about it, but it does work.

P.S. This can also be done with a mod's LuaRules, it has
control over all units and features.

Posted: 11 Mar 2007, 07:26
by AF
Argh, RENDERTYPE_TREE is just part of mapconvs internal workings, it doesnt actually shunt RENDERTYPE_TREE into the map file, it just randomly places tree+random nubmer between 1 and 16 as a feature at that position before it reads your feature definition file.

Posted: 11 Mar 2007, 07:30
by Zoombie
Does this mean that we can finally have tree dependent mods? Er...mod dependent trees?