Thread Tools
Old February 21, 2001, 04:30   #1
Huysmans_666
Chieftain
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Somewhere over the Rainbow ........
Posts: 40
Bringing barbarians back to the oceans of CTP2
HI Y'all !

Did you like those barbboats in CIV1 very much, I know I did, just when you where about to land your trireme on uncharted land a little red boat would appear and sink your fleet !
Isn't that fun

what I want to do is bring them back, I want to see barb battleships roam the sees, but I NEVER EVER programmed even a word in SLIC so I need your help !!

Everyone who has suggestions about what should be in this mod and everyone who would like to give me some pointers as to programming in SLIC would be greatly appreciated

Here r a few things I thought of :
- To see what kind of boats you could ginve the barbs first look to see how the players r advancing...you might want to take the strongest player (AI or not) and go from there.
So if AI player 1 has battleships but the others have trireme give the barbs battleships, it makes things more exiting !
- Second, how many boats would be wise to generate and must we keep count of how many are destroyed, when the number of boats reaches 10, generate new ones OR do we generate new boats each 20 turns or so ?
-Third, but this is a long shot, how do I create barb transports and carriers with payload, and do we want to give the brabs subs with nukes ????? I think not because they are bound to fire them wich in turn creates uncontrollable pollution ! But if you guys want that ........

GIVE me some ideas to work with, what would you like to see happening ! Please let me know !
Can't wait to hear from Y'all !
Huysmans_666 is offline  
Old February 21, 2001, 05:07   #2
Huysmans_666
Chieftain
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Somewhere over the Rainbow ........
Posts: 40
Well here I am in my own thread, my question is bound to be posted somewhere but the barbs...which number is that is that civ[0] for example.

Because otherwise I might start making units for civ1 ! that would be not so nice

Small question aint it !
Huysmans_666 is offline  
Old February 21, 2001, 11:52   #3
Steve5304
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Racine ,WI USA
Posts: 483
its fairly simple....Right click on your Slic File and hit "open with" ......Then find Notepad or Wordpad...And figure it out from there....I think your gonna need an entire new slic...I think it may be impossible to edit that attribute to this game.And yes i remember the stupid Barbarians from Civ2.Always come and Land near your capitol. Coming on Trimes nd Cravals if i remember correctly.....
Steve5304 is offline  
Old February 21, 2001, 11:53   #4
Steve5304
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Racine ,WI USA
Posts: 483
its fairly simple....Right click on your Slic File and hit "open with" ......Then find Notepad or Wordpad...And figure it out from there....I think your gonna need an entire new slic...I think it may be impossible to edit that attribute to this game.And yes i remember the stupid Barbarians from Civ2.Always come and Land near your capitol. Coming on Trimes nd Cravals if i remember correctly.....
Steve5304 is offline  
Old February 22, 2001, 05:13   #5
Huysmans_666
Chieftain
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Somewhere over the Rainbow ........
Posts: 40
This is whatI have so far, I programmed a loop to check every turn if one of the players has got an advance where they recieve a waterunit, ex steel.

If that is so than a random number of units is created, but I have to assign these units to the barbs, how the hell do I do that.

What player number does the barbs have ?

If I get this then pretty soon I will be able to make a working script, because it's vacation time !!! YEEEHAAWW !

I can program my mod all day and hope to have a beta ready for testing about the fifth of march.
I want to do it well and not just half of it

Hope you have the patience to wait, it's going to be good ! (I hope)

Still, anything is welcome !

Greeetinx and happy vacation time
Huysmans_666 is offline  
Old February 22, 2001, 15:59   #6
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 10:55
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
I think player[0] is the barbarians.
Will your checking for advances lead to thousands of barbarian sea units, or will you do an "every Nth turn loop" or something ?
Immortal Wombat is offline  
Old February 22, 2001, 17:02   #7
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 11:55
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Good to see you picked this up, Huysmans
Actually, barbarian player is player 0, not player[0]. The difference may seem trivial but it isn't. player[0] is a variable that will change throughout the game (just as the rest of the player[] array) and it is the value 'inside' this array-element that determines the actual player. So to use the barbarians, simply use 0 where you'd normally use player[0]. However, if you need properties of the barbarians, such as how many units they have, you'll have to put them in one of these variables first, like this:

player[3] = 0; // barbarians (3 could be any number)
tmpValue = player[3].units;

Hope this helps,

Wouter

PS Vacation? What's that? I vaguely seem to recall the term but it's been such a long time, I don't even remember what it was...
Locutus is offline  
Old February 22, 2001, 21:00   #8
Dale
Emperor
 
Dale's Avatar
 
Local Time: 19:55
Local Date: October 31, 2010
Join Date: Dec 2000
Posts: 3,944
Huys:
At the beginning of every turn it's good to check whether the 'current' player is the barbs and then code them. EG:

Code:
HandleEvent(BeginTurn) 'CheckForBarbs' pre {
     if(g.player == 0) {
          // This is for code to perform when barbs turn
          // You could write code to find a spot to spawn from - "location_t barbtmploc;" and then assigning a location to barbtmploc.
          // Then using barbtmploc you create the unit
          CreateUnit(0, UNIT_CATAMARAN, barbtmploc, barbtmpunit);
          // barbtmpunit is the variable to store the new unit if you want to assign an order to it yourself rather than the AI assign to it.  "unit_t barbtmpunit;"
     }
}
Hope this helps mate.

------------------
Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."
Dale is offline  
Old February 23, 2001, 04:29   #9
Huysmans_666
Chieftain
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Somewhere over the Rainbow ........
Posts: 40
Locutus, Dale : Great to see such great minds help out a little SLIC programmer.

I'm currently in the proces of just spawning a barb unit in the sea but even that doesn't work.
I use the makelocation, where the location is combined of a x and y.
I randomize the x and y between certain values ex 25
So I'm left with tmp_loc but then I have to check if the newly created tmp_loc is a water square...this is not a problem.
If it's not randomize another set of x and y and go over the loop once more.
BUT THE makelocation doesn't work it says out of bounds error !
No matter what I do !

I'll write your advice down, but first lets create a unit, that's the basic part, on water
I think that I'll write the advance checking routine at the beginturn routine, then I can make a loop which checks all players, if that player has one of those advances....then set a global variable to 1 and use this in the barbsturn routine.
Is this any good ?

I'm thinking of how much units to spawn, in the beginning I think not so very many, but in the end when everone has a fleet, than it's ok to spawn whole fleets of barbs....what do you think ?

So you see, there's a lot of work to be done

Locutus, don't you have springbreak ? (carnavalsvakantie) Sorry folks that was a dutch term and I don't know how to put it in english !

Well I'll hope to have a beta ready soon, I have some great ideas but this searching for water square doesn't work...GOe$#@@#$#$@#it !

See Y'all, I'll be on the forum a lot even though I have vacation !
Huysmans_666 is offline  
Old February 23, 2001, 07:30   #10
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 10:55
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
quote:

Originally posted by Locutus on 02-22-2001 04:02 PM
Actually, barbarian player is player 0, not player[0]. The difference may seem trivial but it isn't. player[0] is a variable that will change throughout the game (just as the rest of the player[] array) and it is the value 'inside' this array-element that determines the actual player. So to use the barbarians, simply use 0 where you'd normally use player[0]. However, if you need properties of the barbarians, such as how many units they have, you'll have to put them in one of these variables first, like this:

player[3] = 0; // barbarians (3 could be any number)
tmpValue = player[3].units;



Which is why I leave SLIC alone as much as I can. I can't cope with all these weird terms!
Immortal Wombat is offline  
Old February 23, 2001, 08:09   #11
Locutus
Apolytoners Hall of FameCiv4 SP Democracy GameCiv4 InterSite DG: Apolyton TeamBtS Tri-LeagueC4BtSDG TemplarsC4WDG Team ApolytonCivilization IV CreatorsCTP2 Source Code ProjectPolyCast Team
Deity
 
Locutus's Avatar
 
Local Time: 11:55
Local Date: October 31, 2010
Join Date: Nov 1999
Location: De Hel van Enschede
Posts: 11,702
Huysmans,

The explanation of the problem would become a whole lot more understandable if you posted the actual sourcecode as well (use to ubb-tag code to make it look understandable). Out of bound errors indicate that you made some sort of mistake in an array (you probably already figured that out), so double check every occurance of an array(-element) in your code. Can't say more about it until I see the source.

Carnaval? Ahh, that explains why half the people I encountered today were dressed up so funny Nope, here at the University of Twente we only have a (short) Christmas break and a summer vacation, the rest of the year you can take a day (or week or months or whatever) off whenever you want, but the schedule simply doesn't always allow this. Currently I find myself working 70+ hours a week just to get my schoolwork done, so not much time for vacation (or sleep for that matter)
Locutus is offline  
Old February 23, 2001, 11:03   #12
Huysmans_666
Chieftain
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Somewhere over the Rainbow ........
Posts: 40
Hi guys,

Wanted to say thanx for all the support on this one, and indeed like you said locutus, it gets easier if you practice a lot.
And now it's even fun to do, I WANT it to work, so eventually it will !

Well, I just heared I have to work next thursday so I'll hope to post a version then, but don't count on it !

Locutus, the beta code will be coming to you soon, I just worked out the rough edges so it should take form any day know.
Only problem is...I code at work where I don't have CTP2 to actually test the stuff so I'm going home now with the script to test it (Hope my computer doesn't blow up ! )

I see little ideas about the pirates....WHAT WOULD YOU the users like in my script, tell me and I'll see to it that it gets in !

If noone talks to me, I just made this script for myself and noone else...kinda sucks then !

Well hope to hear from you soon !

greetinx, Huysmans
Huysmans_666 is offline  
Old February 24, 2001, 01:19   #13
WesW
Apolytoners Hall of Fame
 
WesW's Avatar
 
Local Time: 03:55
Local Date: October 31, 2010
Join Date: Mar 2007
Location: Florence, Al., USA
Posts: 1,554
Myself, I would like the code to make the Pirates sea-based complements to the land Barbarians. I would like for them to start appearing about 125 turns into the game, and keep appearing until the end of the Renaissance age, about turn 400 in my mod.
They would be created outside the boundaries of civs, like the Barbarians.

Ideally, I would like for both warships and transports to be available to the Pirates, with the specific types the same as those available to the civs in the game at that time.
The transports would be supplied with a couple of land units, comparable to the land Barbarians available at that time, and these transports would then proceed to the nearest city and unload those land units on the shore there.
Warships would pirate trade routes, pillage improvements and attack any ships they came across.

Specific enough?
WesW is offline  
Old February 25, 2001, 00:11   #14
XMon
Warlord
 
XMon's Avatar
 
Local Time: 04:55
Local Date: October 31, 2010
Join Date: Sep 2000
Location: Tampa, Florida
Posts: 117
In the modern era I'd restrict the pirates to having PT Boats and perhaps Transports. I can't think of any terrorist orgs or guerilla armies that can afford large warships. I have read of drug cartels purchasing ex-Soviet subs so maybe non-nuclear subs could be included. While we're talking boats...I'd love to see a sprite of a military transport ship (the CTP transports look like cruise ships) and then make the current Transport only be able to carry civilian or stealth units. Just an idea....
XMon is offline  
Old February 25, 2001, 01:04   #15
Immortal Wombat
Apolytoners Hall of Fame
Prince
 
Immortal Wombat's Avatar
 
Local Time: 10:55
Local Date: October 31, 2010
Join Date: Dec 2000
Location: in perpetuity
Posts: 4,962
Everything Wes said, but not the ending at the end of the Renaissance, there are still Pirates on the oceans of the 21st century. They should however be vastly reduced in number with the invention of modern warships (ironclad perhaps).
Immortal Wombat is offline  
Old February 25, 2001, 18:32   #16
Dale
Emperor
 
Dale's Avatar
 
Local Time: 19:55
Local Date: October 31, 2010
Join Date: Dec 2000
Posts: 3,944
Huys:
When scripting the withdraw mod I got an Out of Bounds error on my array when the script tried to withdraw a unit to an invalid terrain type. Remember that some of the anchient ships can ONLY be shallow/beach terrain types. You will error out if you try to put them in any other terrain. Remember to check for that.

------------------
Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."
Dale is offline  
Old February 26, 2001, 22:14   #17
XMon
Warlord
 
XMon's Avatar
 
Local Time: 04:55
Local Date: October 31, 2010
Join Date: Sep 2000
Location: Tampa, Florida
Posts: 117
Just a bit of clarification...just above there I mentioned that I'd like to see a different, more military-looking, transport sprite. Well, Wes has the "Liberty Ship" sprite in CTP MedMod. I know about that sprite but was planning on using that as a SIGINT spy ship. Kind of like the spy satellite but waterborne and appearing earlier in the game. Just wanted to clarify that I like that sprite but plan on using it for something else. It'll make for a fine spy ship.
XMon is offline  
Old March 1, 2001, 04:25   #18
Huysmans_666
Chieftain
 
Local Time: 09:55
Local Date: October 31, 2010
Join Date: Jan 2001
Location: Somewhere over the Rainbow ........
Posts: 40
Hi everyone,

Great to be back, I've been on a little vacation, actually 4 days of uninterrupted partying and doing whatever you like.
In my country they call that Carnaval ! it's great !

Thus my code hasn't gone that far, it worked for a short period of time, but now, I can't get it to work properly, while loading after a while it just hangs.
I think that it has an infinite loop somewhere but that's the weird part, there is none ! ?

I think that I mail the code to locutus and maybe he can check it out, error out the code, the rough material is there, now to edge it out a little.

Hope to have a beta out soon, but I won't have all the features that you like, patience now

Well, gotta go, work to be done !

bye
Huysmans_666 is offline  
Old March 2, 2001, 01:52   #19
Jerk
Chieftain
 
Jerk's Avatar
 
Local Time: 03:55
Local Date: October 31, 2010
Join Date: Nov 2000
Location: Green Bay, WI USA
Posts: 81
Dale,
To avoid the problem of putting some boats out in the middle of the ocean that can't move out there I would just create UNIT_PIRATE_BOATTYPE and just give them the ability to move on ocean squares. That way you don't have to worry about it through slic or give the pirates a boat that far exceeds the combat ability of anything else out there. This also gives them the potential to flee to safe waters.

Huysmans_666,
I would alter your code to just pick one single random tile on the map and then check to see if it is water. If it's not I suggest using GetNearestWater(fromLocation, toLocation) to find the closest one. This avoids long waits while it picks tiles randomly on the map. This also might be more friendly to people who choose to max the land slider. Additionally, you will want to make sure you aren't plunking down pirate ships on one landlocked ocean square. I would use IsContinentBiggerThan(location,size) to check for this. According to the slic2 function page it works on ocean sizes as well as land mass sizes.

Jerk is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 05:55.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team