Easter Egg Resurrection

Easter Egg Resurrection

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Easter Egg Resurrection

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

I bow in your divine presence.... Basically...












HELL YEAH!!!!!
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Post by LOrDo »

That would be SOOO cool for Single Player missions.
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

zomg treekrog ambush.
Sheekel
Posts: 1391
Joined: 19 Apr 2005, 19:23

Post 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!
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Argh mapconv needs patching, not the engine.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

I know, sorry, I mis-wrote that. Mapconv is setting the RENDERTYPE_TREE :P
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
User avatar
Zoombie
Posts: 6149
Joined: 15 Mar 2005, 07:08

Post by Zoombie »

Does this mean that we can finally have tree dependent mods? Er...mod dependent trees?
Post Reply

Return to “Lua Scripts”