Jump to content

How do I deactivate a unit when a certain other unit is build?


Fynbos
 Share

Recommended Posts

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.png

http://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.png

http://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.

Link to comment
Share on other sites

You could probably code it into the GC events.

http://i55.photobucket.com/albums/g154/codeuser/sigcopy.jpg

http://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.

Link to comment
Share on other sites

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.png

http://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.

Link to comment
Share on other sites

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 level

Replace '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

Link to comment
Share on other sites

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.png

http://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

-1

or if its

1)

 

 

Thats what yours does?

to Bria Tharen!

 

http://img118.imageshack.us/img118/7831/ueawsig4mu9.png

http://www.vereinte-nationen.de/german.gif Ich spreche auch Deutsch.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

Copyright (c) 1999-2022 by SWRebellion Community - All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Star Wars(TM) is a registered trademark of LucasFilm, Ltd. We are not affiliated with LucasFilm or Walt Disney. This is a fan site and online gaming community (non-profit). Powered by Invision Community

×
×
  • Create New...