August 22, 2002, 10:58
|
#1
|
Emperor
Local Time: 23:45
Local Date: October 31, 2010
Join Date: May 1999
Posts: 3,156
|
Hidden Nationality SLICable?
Anyone been playing Civ3 and see how privateers work? The hidden nationality lets you attack without declaring war or your enemy knowing who you are. it adds another challenge, mainly when you apply the ability to a ground unit and even bettera stealth bomber or submarine.
I know CTP2 has invisible units and great unconventional units, but is there something similar to this or even is this SLICable?
|
|
|
|
August 22, 2002, 11:44
|
#2
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
|
I imagine the unit's shield could be a stumbling block.
__________________
Concrete, Abstract, or Squoingy?
"I don't believe in giving scripting languages because the only additional power they give users is the power to create bugs." - Mike Breitkreutz, Firaxis
|
|
|
|
August 25, 2002, 19:15
|
#3
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: Great Britain
Posts: 684
|
Even still the unit would be a good little addition to CtP2. A Naval special unit. Thats if it could be done
|
|
|
|
August 30, 2002, 08:43
|
#4
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
Is there just the pirate ship in civ3 or also other units with hidden nationalities?
I gave this some thought and here's what I came up with:
We create a new unit. I'll be civilian and hidden like spies so it can wander enemy territory without problems. Now, for the tricky part: Attack
We'd use the following event to trigger this: SleepUnit(unit_t)
When you select sleep for a hidden nationality unit a slic code wakes the unit again (so sleeping is actually disabled for those unit), looks for enemy unit in a square next to it and if found
1. kills it. ->Not desirable because no risks and no real battle. We could however adjust that and just give out hitpoints acording to strength - would make us write our own battle routine though.
2. possibility: it creates a barbarian unit that's supposed to attack. But can we tell a Barbarian unit to do one of those events during another players turn?
Battle(army_t, location_t), StartCombat(army_t, location_t)
other than that we could give it a move order:
MovePathOrder(army_t, location_t)
but would the barbarian ai perhaps change this? Or what if the the unit to be attacked moves before it's the barbarians turn (higly likely)
So who's got some insight into this?
|
|
|
|
August 30, 2002, 09:11
|
#5
|
Super Moderator
Local Time: 08:45
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
MovePathOrder doesn't work it checks if it is possible to move to the target location, and if there is an enemy unit or city it doesn't work. BTW this slic event isn't used by the move order in the orders.txt.
Battle works, I didn't test StartCombat.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
September 1, 2002, 11:23
|
#6
|
Emperor
Local Time: 06:45
Local Date: November 1, 2010
Join Date: Jan 2002
Location: UK
Posts: 3,272
|
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?
__________________
'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you. info here. prove me wrong.
Bush's Republican=Neo-con for all intent and purpose. be afraid.
Last edited by child of Thor; September 1, 2002 at 11:28.
|
|
|
|
September 1, 2002, 13:41
|
#7
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
Quote:
|
Originally posted by child of Thor 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?
|
I'm sure there's no way you can't turn it off - that's why I had those two ideas mentioned in the post above. In the first you just see your unit die/get hurt and no enemy unit around - unless you accidently move on the same spot. In the second you'd just see a barbarian come out of nowwhere and attack you. In each case you'd know that an invisible/hidden nationality unit was the cause but you wouldn't know who - unless you had a stealth unit nearby to spot the enemy one.
|
|
|
|
September 2, 2002, 10:39
|
#8
|
Emperor
Local Time: 06:45
Local Date: November 1, 2010
Join Date: Jan 2002
Location: UK
Posts: 3,272
|
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?
__________________
'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you. info here. prove me wrong.
Bush's Republican=Neo-con for all intent and purpose. be afraid.
|
|
|
|
September 2, 2002, 11:33
|
#9
|
Super Moderator
Local Time: 08:45
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
Quote:
|
Originally posted by child of Thor
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?
|
I know that the AI uses the subs like conventional units to pillage my coasts, fro the tips and message boxes I would say the AI gets none of them. For the subs you could use the cheat editor place a city with some sea improvements and switch over to a different civ place then a sub of that on a sea improvement and pillage it if you recieve a message that you are now at war then it works like with the conventional units. Of course make shure first that both nations have contact. BTW if I use the slaver then I get a declaration of war.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
September 2, 2002, 12:41
|
#10
|
Emperor
Local Time: 06:45
Local Date: November 1, 2010
Join Date: Jan 2002
Location: UK
Posts: 3,272
|
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!)
__________________
'The very basis of the liberal idea – the belief of individual freedom is what causes the chaos' - William Kristol, son of the founder of neo-conservitivism, talking about neo-con ideology and its agenda for you. info here. prove me wrong.
Bush's Republican=Neo-con for all intent and purpose. be afraid.
|
|
|
|
September 5, 2002, 03:37
|
#11
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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
|
|
|
|
September 5, 2002, 04:53
|
#12
|
Deity
Local Time: 08:45
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
One could give the unit 0 Attack, a high Ranged value and Bombard capabilities. That way at least the human player wouldn't know who's attacking (bombarding) him. I don't know about the AI though...
|
|
|
|
September 5, 2002, 05:25
|
#13
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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?
|
|
|
|
September 7, 2002, 13:58
|
#14
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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.
|
|
|
|
September 7, 2002, 16:16
|
#15
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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.
|
|
|
|
September 7, 2002, 16:16
|
#16
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
and c:
|
|
|
|
September 7, 2002, 20:21
|
#17
|
Deity
Local Time: 08:45
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
Rather than event 'Battle' you could try using some of the movement-related events to get the Barb unit to attack in the same turn: when CtP2 was still under development and Harlan suggested MAD as addition to the game, Mr Ogre told us that that was possible because at that time, units couldn't move outside their own turn. A few days later he reported MAD would be implemented after all since he had found a way to make units move outside their own turn. That might be key here: he may have created a new event that made units move without checking if this was legal. There are many movement related events in the game, so if you try some of these to get the unit to move into the square that should be attacked, that *might* just work...
|
|
|
|
September 7, 2002, 20:42
|
#18
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: Great Britain
Posts: 684
|
This is the original news topic might be of some interest
[QUOTE](8 July 2000, 09:34 | CtP2) That's right! CTP2 is going to model Mutually Assured Destruction! Here's what Mr. Ogre announced on our forums
We now have a system for targeting and then auto-launching nukes when you get nuked in the main game. I had said we weren't doing anything new for nukes, but I was wrong, we are, it's in and working.
There's still a whole lot more in that monster Nuke thread that we're not doing, but this one "little" thing is pretty cool.
If only we had one of those alpha(?) builds to see this in action... [QUOTE]
Now whatever happened to that idea i wonder? Any thoughts on weather it would be good to implement IF it could be done? And gives some backup that there is code there that could be put to use for the privateer but how????
SMIFFGIG
|
|
|
|
September 8, 2002, 12:04
|
#19
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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; September 9, 2002 at 07:52.
|
|
|
|
September 9, 2002, 02:19
|
#20
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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?
|
|
|
|
September 9, 2002, 05:49
|
#21
|
King
Local Time: 03:45
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
Here is the Elite Unit code wich uses the unitrecord array.
Background: This makes code makes a unit only buildable by a civ that dicovered an advance and got luck ina 1/6 random number.
Our CTP2 version of unique units.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
|
|
|
|
September 9, 2002, 07:50
|
#22
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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.
|
|
|
|
September 9, 2002, 09:24
|
#23
|
Super Moderator
Local Time: 08:45
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
Quote:
|
Originally posted by mapfi
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.
|
The file name looks like taken from MedPack2 and the features that it should have are also part of MedPack2.
So play MedPack if you want to see this in action.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
September 9, 2002, 10:46
|
#24
|
King
Local Time: 03:45
Local Date: November 1, 2010
Join Date: Jul 2001
Location: of Natal, Brazil
Posts: 2,555
|
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.
__________________
"Kill a man and you are a murder.
Kill thousands and you are a conquer.
Kill all and you are a God!"
-Jean Rostand
Last edited by Pedrunn; September 9, 2002 at 10:53.
|
|
|
|
September 9, 2002, 13:27
|
#25
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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?
|
|
|
|
September 9, 2002, 16:57
|
#26
|
Deity
Local Time: 08:45
Local Date: November 1, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
|
Quote:
|
Originally posted by mapfi
factor = tmpUnit2.hp*unitrecord[0].Defense;
|
This line is the problem. You can't just use unitrecord[0] out of context, it will give you a void unit record, meaning that all values from it will be 0. Some value should be assigned to unitrecord[0] before it can be used, just like with unit[0], city[0] and any other object. But since you can't assign a value to a unitrecord object yourself, you must use a different approach, namely the database functions:
Code:
|
factor = tmpUnit2.hp*UnitDB(tmpUnit.type).Defense; |
|
|
|
|
September 10, 2002, 01:38
|
#27
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
Code:
|
unitrecord[0] = tmpUnit2.type; |
You mean that part is not working? Thanks a lot, I'll try tonight.
|
|
|
|
September 10, 2002, 15:55
|
#28
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
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???
|
|
|
|
September 10, 2002, 16:16
|
#29
|
Super Moderator
Local Time: 08:45
Local Date: November 1, 2010
Join Date: Mar 2001
Location: Tübingen, Germany
Posts: 6,206
|
Quote:
|
Originally posted by mapfi
The temp variables in this handler are reinitialized each time for sure, aren't they?! What else could it be???
|
No, the temp variables are just initialized once, that is true for every other variable, too. That saves some time. I learned this lesson the hard way as I tried to used an array to store location data and wondered why the ComImpsForAIs3.slc code still build the tile imps, even if all coditions were wrong. The current version allows now the array to grow to infinite, so far no problems weren't reported. That is actual a memory lack, and I don't know how to reduce the size of the array afterwards it has been grown dinymically. When Dave release Cradle v.1.33 I will put the latest version into the directory, I hope I don't have to modify it.
-Martin
__________________
Civ2 military advisor: "No complaints, Sir!"
|
|
|
|
September 11, 2002, 03:01
|
#30
|
Prince
Local Time: 07:45
Local Date: November 1, 2010
Join Date: Jul 2002
Location: San Francisco, CA
Posts: 848
|
You're saying my int_t end stays 1 after this code has been executed the first time? If so then it's clear why it won't work. But hey, what a screwed language this is!!!
|
|
|
|
Posting 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
|
|
|
All times are GMT -4. The time now is 02:45.
|
|