Fynbos Posted March 15, 2007 Posted March 15, 2007 Yes, the subject says it all: How do I deactivate a unit when a certain other unit is build? I want to deactivate the build option for a certain unit, when another certain unit is build.(At best: when it is build, not when its building, but I could live with it.) Any ideas? I would prefer to not make it an upgrade... to Bria Tharen! http://img118.imageshack.us/img118/7831/ueawsig4mu9.pnghttp://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.
HK-47 Posted March 15, 2007 Posted March 15, 2007 Good question... I also wanted to know that... :Some time ago I asked if it was possible to build a certain unit after someother was destroyed... People answered that I would need LUA coding or story plots, I think...
Dark_Dragon Posted March 15, 2007 Posted March 15, 2007 this thread seems to be similar to what you are asking for http://pff.swrebellion.com/http://www.swrebellion.com/phpBB3/viewtopic.php?p=50225#p50225
Fynbos Posted March 16, 2007 Author Posted March 16, 2007 Nope, quite different. This one is about deactivating a unit after another is build, the other thread is about techlevel deactivation which does not work in GC / is buggy, since it will be not used when you overstep the given techlevel. to Bria Tharen! http://img118.imageshack.us/img118/7831/ueawsig4mu9.pnghttp://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.
Dr. Nick Posted March 16, 2007 Posted March 16, 2007 You could probably code it into the GC events. http://i55.photobucket.com/albums/g154/codeuser/sigcopy.jpghttp://i12.photobucket.com/albums/a245/loverdog/pffuserbar2.jpg[3:52:33 PM] Arbiter says: Paracetamoxyfrusebendroneomycin would cure all of his diseases....[3:52:47 PM] Arbiter says: Except with the side effect of probable death.
Fynbos Posted March 16, 2007 Author Posted March 16, 2007 No, because of 2 things: - Things coded into the GC-techlevel-spawns to be deactivated do not work when you "jump over" them.For example: When you want to be Vader disabled when you reach techlevel 2, it will work when you start with techlevel 1 and then get the techupdate.But if you start that same GC with Level 2 at the beginning, Vader will still be there.I tested this twice, but if I am wrong, please tell me. - As I said: I dont want to have it tech-dependend, I want it unit-dependend. to Bria Tharen! http://img118.imageshack.us/img118/7831/ueawsig4mu9.pnghttp://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.
jedi_consulor Posted March 16, 2007 Posted March 16, 2007 Nope, quite different. This one is about deactivating a unit after another is build, For example I have recently used this code in my own mod for SOTE, you start the game at Tech 1 you get the providence, start the same game at Tech level 5 - its not buildable any more. I know this because I tested it as working as such. What ever your doing must not be right. the other thread is about techlevel deactivation which does not work in GC / is buggy, since it will be not used when you overstep the given techlevel. Hmm I actually beg to differ,. I tested the code I did, to remove a unit based on other code. It does work in GC mode other wise I would not have posted in that thread to say how to remove a unit at a certain tech level. The code works fine and is not about tech level deativation, it's about deactivating a unit 'AT' a certain tech level. Use: Deactivate unit at what ever tech levelReplace 'With' Unit at that tech level,. Nothing about deativating tech levels just units you want removed. Plus when you over step a certain tech level the unit is no longer buildable. I know that code works because I have tested it several times. The code I posted does not suit your purpose because you want the unit disabled - not disabled at a tech level which is what that code does,. Plus that code needs to be in every sandbox file for every campaign you want to remove the unit at. If your looking to disable a unit from being built - your better just removing the build option from the actual unit, and have it spawn some how some where else in your game. http://i37.photobucket.com/albums/e99/drone_pilot/JC_Sig.jpg Sote Mod Website @ http://sote-mod.com/forum/index.php?act=home
Fynbos Posted March 16, 2007 Author Posted March 16, 2007 So, you say the activation and the deactivation with the textlevels in the sandbox files work.Even when you not start from the lowest tech and work your way all up, but start on highest level directly? If your looking to disable a unit from being built - your better just removing the build option from the actual unit, and have it spawn some how some where else in your game.Like? A hero is not sufficiant.They are spawned on techlevels and not on units. The problem is not to allow a unit or build or spawn, but to deactivate one when another is build.Simple "Either this - or that". :-\ to Bria Tharen! http://img118.imageshack.us/img118/7831/ueawsig4mu9.pnghttp://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.
z3r0x Posted March 17, 2007 Posted March 17, 2007 You can also remove the unit from play also.. not just make it no longer buildable
jedi_consulor Posted March 17, 2007 Posted March 17, 2007 So, you say the activation and the deactivation with the textlevels in the sandbox files work.Even when you not start from the lowest tech and work your way all up, but start on highest level directly? Whats this about text levels ? - sorry bud - you lost me there. The code I posted works no matter which way you use it. Start at Tech 1 - get the unit you like and loose it at Tech 3 if you wish and it is replaced by another unit. This is then deactivating the other unit from play, - it cannot be built any more. Existing built units will still be playable until destroyed. This is not a bug - its just that you built then before the unit was removed from play. All the code actually will do is remove a unit from the build tab - ok ? Like? A hero is not sufficiant.They are spawned on techlevels and not on units. The code I posted only remove units - not heroes. Hero removal code through the same method is different code. By the way that code is buggy and doesn't remove them properly. But the code I posted is not for hero units. The problem is not to allow a unit or build or spawn, but to deactivate one when another is build.Simple "Either this - or that". :-\ The code does NOT remove the unit from the game to stop it spawning, the code stops a unit being built at a specified Tech Level. I cannot be more clear about this. Yes it does what you asked, It stop's one being built on a build tab and replaces that unit with a new one. This code works 100% I have tested and use this code in SOTE and my older mod BOP. If you were to start a game at tech level 5 and the unit is written in the Sandbox files to be removed at say Tech Level 3 - the unit will not be available at tech 5 - because the code in the Sandbox files tells the game its been removed from play and replaced with a new unit. Z3r0x is basically saying the same as me - the only true way to remove a unit is to stop it being buildable in the units xml file. You would then need to have it called up some where else in the game - such as being spawned, or being an escort for another space unit type. JC http://i37.photobucket.com/albums/e99/drone_pilot/JC_Sig.jpg Sote Mod Website @ http://sote-mod.com/forum/index.php?act=home
Fynbos Posted March 18, 2007 Author Posted March 18, 2007 The code I posted only remove units - not heroes. Hero removal code through the same method is different code. By the way that code is buggy and doesn't remove them properly. But the code I posted is not for hero units. Thats what I tried.So that hero code is buggy and that was what I tested back then.The regular unit remove works, yes. See: Z95. If you were to start a game at tech level 5 and the unit is written in the Sandbox files to be removed at say Tech Level 3 - the unit will not be available at tech 5 - because the code in the Sandbox files tells the game its been removed from play and replaced with a new unit. I want to disable a unit from the buildbar, when the other one is build, REGARDLESS of the techlevel. Example:You have the HinkyShip Class 1 and the Hinky Ship Class 2.Both are availble at the same time.You hit the Button for Hinky1.Hinky 1 gets build.Hinky 2 vanishes from the buildbar.(Dont care that much if it comes back, after Hinky1 is destroyed, if Hinky1 is 1-1or if its1) Thats what yours does? to Bria Tharen! http://img118.imageshack.us/img118/7831/ueawsig4mu9.pnghttp://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.
jedi_consulor Posted March 18, 2007 Posted March 18, 2007 ok, well what you want to do can't be done that way. You see it is the Sandbox files that control what units appear in the game at a specific tech level. I have not seen any code that will allow you to remove a unit regardless of what tech level you are on. This is WHY I did my own code so it removes a unit by tech level. It really is the only way I have ever seen to do this. As I already said the code works by removing a unit at what ever tech level you want to get rid of that unit - and replaces it with a new one. But the thing is this requires you add this to your Sandbox files and you place the code at the tech level you want to remove the old unit at. I do not think there is another way of doing this.. http://i37.photobucket.com/albums/e99/drone_pilot/JC_Sig.jpg Sote Mod Website @ http://sote-mod.com/forum/index.php?act=home
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now