 |
|  |
 |
|
child of Thor
|
|
Going on what IW said about the unit shield, i guess as mapfi say's it's logical to make it a stealth unit like the spy, so it can only be spotted by specific enemy units. When you pirate a trade route for example, or if someone pirates yours - then you sometimes get a text box informing you of the event(i guess there is a % chance of detection somewhere in the trigger for those actions).You could just leave this trigger out so neither the player or the AI would know who performed it without actually having units in the location to spot the stealth unit.
When you have a sub, you are pretty much invisible(and your shield),except to a few units - so no problem there. If it's possible to hide the units activities(like a spy spying or stealing tech), then it seems possible? Or maybe i'm not understanding how stealth units really work?
Attack is a tricky one - i'm pretty sure you always know who it is who attacks you and visa-versa..........can't think of any exceptions But maybe it's just something that can be turned off?
Last edited by child of Thor on 01-09-2002 at 20:28
|
|
|  |
 |
|
child of Thor
|
|
well in that case maybe the first option would be best, although the second is o.k. Hmmm? It wouldn't matter that a special unit could see your unit - that's what they are for after all.Might have to make the A.I. give greater priority to haveing a special unit in it's armies if it starts to come under this special attack more than a few times.
It would be a nice addition - although if it's a big job to do, i'm more than happy with the present selection of special units already. Just a thought, does anyone know if you use a sub to pirate trade routes is it just the same as if you used a non-stealth ship - does the A.I still get the same tip-off/player same message box?
|
|
|  |
 |
|
child of Thor
|
|
Thanks Martin, i also seem notice the AI pillaging my coasts with subs, just never really noticed if it happend outside of the 'view' of any sub-detecting ships. I'll try a MP game and see how it works on that( I like to test stuff this way so i can see how cool mp can be!)
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
Ok, so the thing I'm going to try whenever I find the time is the naval unit, a pirat ship with the following abilities:
Civilian unit, stealth unit, can attack a enemy ship without disclosing it's nationality (don't know yet which workaround i'll use), can pirate trade routes, can pillage
would be cool if anybody could extract the graphics of the privateer from civ3 for me
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
The AI is certainly a problem and wouldn't bombarding also declare war? Just thought of another possibilty: If in the attack order I execute my special-attacking slic and then return STOP, would that prevent the enemy from knowing who it was?
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
Okay, I changed the settings of the longship instead of creating a new unit just for testing. What works is this - the AI doesn't declare war on me, so he doesn't know who's done it. Nevertheless through the cheat editor I see, that the ship becomes visible after the stopped attack, so it won't work in multiplayer.
If you want to have a lok at it, here it is... Desperate to keep my regular game clean from any modding I always create a new mod, so that's how this is set up.
Next, I'll try the solution with the barbarians.
Attachment: hina.zip
This has been downloaded 4 time(s).
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
Here are the next two. The trigger for the attack is the entrench order for the longship as it can't attack with this setting. The code checks all tiles around and in b kills the enemy unit, in c creates a barbarian battleship nearby which is killed after it has done one attack. However, the barbarian ship can't attack during my turn even though I tell it in the code to do so. So if you don't dissappear with your ships immeadetly it might attack you.
I think I'll try further with b even though one could argue that c is also realistic since government paid pirates tend to be unpredictable... I'd still be happy if someone could get the flics of the privateer into ctp2 sprites since I don't have the appropriate programs.
Note: Just now I had the code only execute when there's one longship and one enemy ship. I'll change that, even though I'm thinking pirates will preferably pick on single ships.
Note2: This time I'm packing just the slc and the units.txt, so you need the first one to run it.
Attachment: hina_b.zip
This has been downloaded 4 time(s).
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
and c:
Attachment: hina_c.zip
This has been downloaded 4 time(s).
|
|
|  |
 |
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
code: //MoveUnits(army_t, location_t, location_t)
//An army always moves on this event, no more legality checks at this point
//MADLaunch(unit_t)
//SetTarget(unit_t, city_t) Give a nuclear missile (unit) a target
//TargetOrder(army_t, location_t) Give a nuclear missile a target
//INT CreateCity(owner, nearlocation, distance[, savecity])
I've tried all those. The first one has no effect even though it says the army should move.
The second one always gives me a serious error in the ctp.exe while executing no matter how I try. E.g I tried to just create a city at that spot to use settarget. That's all events/functions I could find in the documentation. In the NuclearWar scenario there's a function called code: TargetNuclearAttack(1, 2, 1)
but without knowing what the values stand for...
Edit: Made the post a little narrower...
Last edited by mapfi on 09-09-2002 at 16:52
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
Played with other possibilities too, e.g. my own battle deciding algorithm. I had to use the unitrecord variable for accessing the defense value of a unit but somehow the code doesn't work exactly the way I want it yet. Has anybody any experiences with unitrecord array?
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
Thanks Pedrunn. Seems like I used it the correct way then.
Off the Thread-Topic: Is this code included in any particular mod? I find the refugee bit pretty attractive.
|
|
|  |
 |
|
Pedrunn
|
 |
of Natal, Brazil
Jul 2001 time: 02:21
|
|
MedMod does have both codes included. But the file isnt from there since I am using it in my owns modifications. The Refugee came as bonus since i was toolazy to take it off. I am glady you liked my laziness consequences though.
Last edited by Pedrunn on 09-09-2002 at 19:53
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
Here's what I've tried now: code:
HandleEvent(EntrenchOrder) 'PrivateerAttack' pre {
unit_t tmpUnit;
unit_t tmpUnit2;
army_t tmpArmy;
army_t tmpArmy2;
location_t tmpLocation;
location_t tmpLocation2;
int_t i;
int_t k;
int_t end;
int_t factor;
int_t factor2;
tmpLocation = army[0].location;
if (UnitsInCell(tmpLocation) == 1) {
GetUnitFromCell(tmpLocation, 0, tmpUnit);
if (tmpUnit.type == UnitDB(UNIT_LONGSHIP)) {
while (i <= 7 && end == 0) {
GetNeighbor(tmpLocation, i, tmpLocation2);
if(TerrainType(tmpLocation2) >= 10 && TerrainType(tmpLocation2) <= 17) {
k = UnitsInCell(tmpLocation2);
if (k == 1) {
GetUnitFromCell(tmpLocation2, 0, tmpUnit2);
if (tmpUnit2.owner != tmpUnit.owner && tmpUnit2.owner != 0) {
unitrecord[0] = tmpUnit2.type;
factor = tmpUnit2.hp*unitrecord[0].Defense;
factor2 = tmpUnit.hp*30;
if (factor2 > (factor*2) / 3) {
KillUnit(tmpUnit2);
}
elseif (factor2 < factor2 / 3) {
KillUnit(tmpUnit);
}
else {
DamageUnit(tmpUnit, 5);
DamageUnit(tmpUnit2, 5);
}
end = 1;
}
}
}
i = i + 1;
}
}
}
return STOP;
}
Funny thing is - it works exactly once and only once like it should - after that any fortify order to my longship has no effect on the enemy's ships anymore. Anybody got a clue?
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
code:
unitrecord[0] = tmpUnit2.type;
You mean that part is not working? Thanks a lot, I'll try tonight.
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:21
|
|
Tried and had no luck - it will still execute once and only once - there must be some other flaw we didn't spot. I took out the unitrecord but now I'm not sure if it wouldn't have worked after all. Locutus did you just not see the assigning lign and it should work after all? Even if, that's not what's going wrong in this thingie. The temp variables in this handler are reinitialized each time for sure, aren't they?! What else could it be???
|
|
|  |
All times are GMT. The time now is 05:21. Apolyton Time is 00:21. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|