• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Tweaking spyglasses

kblack

Landlubber
Storm Modder
I have been able to tweak the spyglasses code in order to give just an "aproximate" information, depending on the quality og the spyglasses.

So, when you look, lets say, the number of sailors, you see variable numbers... so you only can guess how many they will be.

Idem with hulls or sails

Unfortunately, I was expecting that you will get a diferent data each time you opened or closed the spyglass.... no, the numbers are changing continuously.....
... I'll try to fix.

Feel proud. First try with the mods and no crashes (still :) )


Code in BATTLEINTERFACE/ispyglass.c

-------------------------------------------------


void SetSpyGlassData()
{
int chrIdx = GetEventData();
if(chrIdx<0) return;

int shipHull = -1;
int shipSail = -1;
int shipCrew = -1;
int shipCannons = -1;
int shipCharge = -1;
int shipNation = -1;
float shipSpeed = -1.0;
string shipName = "";
string shipType = "";
int shipDistance = 0; // meh
int shipMorale = 45; // NK
int spyglassacc = 0; //KB
int shipCaliber = -1; //KB
string stemp = "" //KB
int vtemp = 0; //KB

......
.......
......

//KB Spyglasses
switch (arScopeItm.id) {
case "spyglass1":
spyglassacc = 4;
break;
case "spyglass2":
spyglassacc = 3;
break;
case "spyglass3":
spyglassacc = 2;
break;
case "spyglass4":
spyglassacc = 1;
break;
}
//KB Spyglasses

.......
.......
else
{
if( !CheckAttribute(arScopeItm,"scope.show.cannons") || sti(arScopeItm.scope.show.cannons)!=0 )
{
vtemp = GetCannonQuantity(chref);
shipCannons = vtemp + makeint(vtemp/10) * (rand( 2* spyglassacc) - spyglassacc);
vtemp = 0;
// Number of cannons variates... so you can't be sure how many... 32 o 44... nice :)

}
if( !CheckAttribute(arScopeItm,"scope.show.ship_name") || sti(arScopeItm.scope.show.ship_name)!=0 )
{
shipName = XI_ConvertString(GetShipTypeName(chref)) + " : " + chref.Ship.Name;
}
if( !CheckAttribute(arScopeItm,"scope.show.ship_type") || sti(arScopeItm.scope.show.ship_type)!=0 )
{
shipType = "Class " + GetCharacterShipClass(chref);
}

// I'm thinking about make possible to confound similar ships i.e a yacht and a barque, or all the variants of Frigates or Galleons.... it will not the same fight against a Light Frigate or against a Frigate


if( !CheckAttribute(arScopeItm,"scope.show.hull") || sti(arScopeItm.scope.show.hull)!=0 )
{
vtemp = rand(2*spyglassacc*5) - spyglassacc*5;
shipHull = makeint(GetHullPercent(chref)) + vtemp;
vtemp = 0;

// I've made harder to guess damage in hull

}
if( !CheckAttribute(arScopeItm,"scope.show.sail") || sti(arScopeItm.scope.show.sail)!=0 )
{
vtemp = rand(2*spyglassacc*2) - spyglassacc*2;
shipSail = makeint(GetSailPercent(chref)) +vtemp;
vtemp = 0;
}
// OTOH, it's really easier to see the real damage in the riggings

if( !CheckAttribute(arScopeItm,"scope.show.crew") || sti(arScopeItm.scope.show.crew)!=0 )
{
vtemp = GetCrewQuantity(chref);
shipCrew = vtemp + makeint(vtemp/10) * (rand( 2* spyglassacc) - spyglassacc);
vtemp = 0;
}
if( !CheckAttribute(arScopeItm,"scope.show.speed") || sti(arScopeItm.scope.show.speed)!=0 )
{
vtemp = rand (2*spyglassacc*3) - 3*spyglassacc;
shipSpeed = stf(chref.Ship.speed.z) + vtemp;
vtemp = 0;
// meh -->
vtemp = rand (2*spyglassacc*5) - 5*spyglassacc;
shipDistance = ( Ship_GetDistance2D(GetMainCharacter(), chref) ) / 10 ;
shipDistance *= 10;
shipdistance = shipdistance + vtemp;
shipType = shipType + ", " + shipDistance + " yards";
// meh <--
}
if( !CheckAttribute(arScopeItm,"scope.show.charge") || sti(arScopeItm.scope.show.charge)!=0 )
{
shipCharge = sti(chref.Ship.Cannons.Charge.Type);
// NK -->
if(shipCrew != -1)
{
if(CheckAttribute(chref,"Ship.Crew.Morale"))
{
shipMorale = sti(chref.Ship.Crew.Morale);
}
shipName = shipName + ", Crew's Morale: " + GetMoraleName(shipMorale);
}
// NK <--
}
}
 
Congratulations on making your first mod! It sounds like a good thing, because you wouldnt be able to know how many crew there were if they were in the lower decks. I think that this one will end up going into the next build patch, when its finished.
 
KBlack,
I second HKD's congratulations! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" />

What a great idea! It adds to the "Fog of War" aspect in that you cannot be 100% certain of anything that's going on. It also reminds me of how Maynard, when he was fighting Blackbeard, ordered his men belowdecks to make it harder for Blackbeard to ascertain how many men he had, and be tricked into closing to board.

Good luck with this! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/keith.gif" style="vertical-align:middle" emoid=":keith" border="0" alt="keith.gif" />
 
If the numbers aren't changing too rapidly, I'd say it would actually be nive to have the numbers continuously changing.
Sounds like a great mod! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
Very nice! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> We'll have to see if we can make it switchable, and we can add it to the rest of the Build stuff. Does it require a new game, to activate?
 
<!--QuoteBegin-CatalinaThePirate+May 25 2005, 02:30 AM--><div class='quotetop'>QUOTE(CatalinaThePirate @ May 25 2005, 02:30 AM)</div><div class='quotemain'><!--QuoteEBegin-->Very nice!  <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />  We'll have to see if we can make it switchable, and we can add it to the rest of the Build stuff.  Does it require a new game, to activate?
<div align="right">[snapback]106906[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->


I am in the second alpha version... now the numbers change slowly, and also certain data can't be seen over certain distances... i.e. the crew numbers, no matter how good are your spyglass, you have to be under 300 yds to start counting them. Item with the ship name and type... over 1000 yds you don't know whay kind of ship you are going to fight (and it's really enjoying to guess WHAT ship it's the escort )
Now I'm tweaking with the formulas (¿?) and parameters to get the most realistic / playability balance...

I feel confident about making it fullly switchable, and "Build ready". And, Catalina, it doesn't require a new game.

(BTW nice Xebec you designed, I sail now in one of yours - the "Esmeralda" - , a real sweet beauty )
 
<!--QuoteBegin-kblack+May 24 2005, 10:48 PM--><div class='quotetop'>QUOTE(kblack @ May 24 2005, 10:48 PM)</div><div class='quotemain'><!--QuoteEBegin-->(BTW nice Xebec you designed, I sail now in one of yours - the "Esmeralda" - , a real sweet beauty ) <div align="right">[snapback]106925[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd--> Glad you like her, she's my main ship through most of the game, unless I decide to do the main quest and need more firepower. I like the smash-and-grab style of piracy, taking ships rather than sinking them, so having a nice agile ship with a small but smelly crew who fight like tigers (because they have a double rum ration) works for me! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/icon_mrgreen1.gif" style="vertical-align:middle" emoid=":cheeky" border="0" alt="icon_mrgreen1.gif" />

Glad you won't need a new game for your new spyglass - maybe we can sneak it into Pieter's Modpack when you get it switchable.
 
An annoying thing with morale, is that it lowers when you lose crew, even if you win a major battle (eg. A small battleship vs a squadron of over 20 class one ships) you still get low morale. I would have thought that people would be happy and pleased with you if you won a major victory over near-impossible odds.
 
I like the sound of this! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" />

Nice idea, can't wait to see it all done! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
High Sea Lass, nice banner! I like your flag! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" />
 
Thanks! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/danse1.gif" style="vertical-align:middle" emoid=":dance" border="0" alt="danse1.gif" />

It's a skull and two crossed roses, heheh! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/laugh.gif" style="vertical-align:middle" emoid="xD:" border="0" alt="laugh.gif" /> Well, she's a lady, after all, it needs that warm, feminine touch! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/whistling.gif" style="vertical-align:middle" emoid=":wp" border="0" alt="whistling.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" />

My hubby got a bandana with those on them, a lot of them, and I thought "Oooh, cool flag for my Crow!" <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/sailr.gif" style="vertical-align:middle" emoid=":sail" border="0" alt="sailr.gif" />
 
Mine is a modified design - well several design elements - from various old tombstones. Have you seen our <a href="http://forum.piratesahoy.net/index.php?showtopic=3198" target="_blank">piratey limerick graveyard?</a>

kblack, how's the progress?
 
Reallynice, thanks <b>kblack</b>! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid=":cheers" border="0" alt="par-ty.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/buds.gif" style="vertical-align:middle" emoid=":drunk" border="0" alt="buds.gif" /> <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile2.gif" style="vertical-align:middle" emoid=":))" border="0" alt="smile2.gif" />
 
<!--QuoteBegin-CatalinaThePirate+Jun 1 2005, 04:35 PM--><div class='quotetop'>QUOTE(CatalinaThePirate @ Jun 1 2005, 04:35 PM)</div><div class='quotemain'><!--QuoteEBegin-->Mine is a modified design - well several design elements - from various old tombstones.<div align="right">[snapback]108686[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->
Ahh, tombey the stones! <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/william.gif" style="vertical-align:middle" emoid=":will" border="0" alt="william.gif" /> I like it. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/yes.gif" style="vertical-align:middle" emoid=":yes" border="0" alt="yes.gif" /> Much nicer animation of the flag too, heh!
 
<!--QuoteBegin-CatalinaThePirate+Jun 1 2005, 04:35 PM--><div class='quotetop'>QUOTE(CatalinaThePirate @ Jun 1 2005, 04:35 PM)</div><div class='quotemain'><!--QuoteEBegin-->Mine is a modified design - well several design elements - from various old tombstones.  Have you seen our <a href="http://forum.piratesahoy.net/index.php?showtopic=3198" target="_blank">piratey limerick graveyard?</a>

kblack, how's the progress?
<div align="right">[snapback]108686[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->


Done. Im gonna to post right now. It's ready for Alpha testing.
I just have tested it once, not totally. At least, the game starts :)
 
<img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/me.gif" style="vertical-align:middle" emoid=":onya" border="0" alt="me.gif" /> Great! Here's a link to the testing thread: <a href="http://forum.piratesahoy.net/index.php?showtopic=5514&hl=" target="_blank">http://forum.piratesahoy.net/index.php?showtopic=5514&hl=</a>
 
Back
Top