Need Help in RM scripting

View previous topic View next topic Go down

Need Help in RM scripting

Post by Pepp on Sat 3 Mar 2012 - 15:57

Well, I tried to modify caribbean map. At first, I just change some small things and the map is still working. But then, when I add these (turkey and nugget3) lines:
Spoiler:
Code:
   // DEER   
  int deerID=rmCreateObjectDef("deer herd");
   int bonusChance=rmRandFloat(0, 1);
  if(bonusChance<0.5) 
      rmAddObjectDefItem(deerID, "deer", rmRandInt(4,6), 10.0);
  else
      rmAddObjectDefItem(deerID, "rhea", rmRandInt(8,10), 10.0);
  rmSetObjectDefMinDistance(deerID, 0.0);
  rmSetObjectDefMaxDistance(deerID, rmXFractionToMeters(0.5));
   rmAddObjectDefConstraint(deerID, avoidAll);
  rmAddObjectDefConstraint(deerID, avoidImpassableLand);
  rmSetObjectDefCreateHerd(deerID, true);
//   rmPlaceObjectDefAtLoc(deerID, 0, 0.5, 0.5, cNumberNonGaiaPlayers*4);
   rmPlaceObjectDefInArea(deerID, 0, bigIslandID, cNumberNonGaiaPlayers);
   for (i=0; <cNumberTeams)
   {
      rmPlaceObjectDefInArea(deerID, 0, rmAreaID("team "+i), cNumberNonGaiaPlayers*0.5);
   }

int deer2ID=rmCreateObjectDef("turkey");
   int bonusChance=rmRandFloat(0, 1);
      rmAddObjectDefItem(deer2ID, "turkey", rmRandInt(4,6), 10.0);
  rmSetObjectDefMinDistance(deer2ID, 0.0);
  rmSetObjectDefMaxDistance(deer2ID, rmXFractionToMeters(1.0));
   rmAddObjectDefConstraint(deer2ID, avoidAll);
  rmAddObjectDefConstraint(deer2ID, avoidImpassableLand);
  rmSetObjectDefCreateHerd(deer2ID, true);
      rmPlaceObjectDefInArea(deer2ID, 0, rmAreaID("team "+i), cNumberNonGaiaPlayers*3);[/color]

Code:
   int nugget1= rmCreateObjectDef("nugget easy");
   rmAddObjectDefItem(nugget1, "Nugget", 1, 0.0);
   rmSetObjectDefMinDistance(nugget1, 0.0);
   rmSetNuggetDifficulty(1, 1);
   rmSetObjectDefMaxDistance(nugget1, rmXFractionToMeters(0.5));
   rmAddObjectDefConstraint(nugget1, shortAvoidImpassableLand);
     rmAddObjectDefConstraint(nugget1, avoidNugget);
     rmAddObjectDefConstraint(nugget1, avoidTradeRoute);
     rmAddObjectDefConstraint(nugget1, avoidAll);
   rmAddObjectDefConstraint(nugget1, avoidTCshort);
     rmAddObjectDefConstraint(nugget1, avoidWater20);
   rmAddObjectDefConstraint(nugget1, playerEdgeConstraint);
   //rmPlaceObjectDefInArea(nugget1, 0, bigIslandID, cNumberNonGaiaPlayers*rmRandInt(1,2));
   for (i=0; <cNumberTeams)
   {
      rmPlaceObjectDefInArea(nugget1, 0, rmAreaID("team "+i), cNumberNonGaiaPlayers*2);
   }

   int nugget2= rmCreateObjectDef("nugget hard");
   rmAddObjectDefItem(nugget2, "Nugget", 1, 0.0);
   rmSetObjectDefMinDistance(nugget2, 0.0);
   rmSetNuggetDifficulty(3, 3);
   rmSetObjectDefMaxDistance(nugget2, rmXFractionToMeters(0.5));
   rmAddObjectDefConstraint(nugget2, shortAvoidImpassableLand);
     rmAddObjectDefConstraint(nugget2, avoidNugget);
     rmAddObjectDefConstraint(nugget2, avoidTradeRoute);
     rmAddObjectDefConstraint(nugget2, avoidAll);
   rmAddObjectDefConstraint(nugget2, avoidTCshort);
     rmAddObjectDefConstraint(nugget2, avoidWater20);
   rmAddObjectDefConstraint(nugget2, playerEdgeConstraint);
   rmPlaceObjectDefInArea(nugget2, 0, bigIslandID, cNumberNonGaiaPlayers*2);

       // THE WATER NUGGETS:
        int nugget3= rmCreateObjectDef("nugget water");
        rmAddObjectDefItem(nugget3, "ypNuggetBoat", 1, 0.0);
        rmSetNuggetDifficulty(5, 5);
        rmSetObjectDefMinDistance(nugget3, rmXFractionToMeters(0.0));
        rmSetObjectDefMaxDistance(nugget3, rmXFractionToMeters(0.5));
        rmAddObjectDefConstraint(nugget3, avoidTeamIslands);
      if (cNumberNonGaiaPlayers<=2)
      {
      rmPlaceObjectDefAtLoc(nugget3, 0, 0.5, 0.5, cNumberNonGaiaPlayers*2);
      }
      else
      {
      rmPlaceObjectDefAtLoc(nugget3, 0, 0.5, 0.5, cNumberNonGaiaPlayers*1);
      }

Well, the game don't want to play it and I don't know how to use debugger, which make the problem worse.

Any help?

Sincerely,
He-Who-Stucked-in-RMS


NOTE: Here is the latest working version.
http://www.4shared.com/zip/Uge6eJAF/Raja_Ampat_v01.html
http://www.4shared.com/zip/fCvJtget/Raja_Ampat_v02.html


Last edited by Pepp on Sat 3 Mar 2012 - 22:18; edited 1 time in total

_________________
Philosophy of gaming: A player is a noobish modder; a modder is a noobish player.

Spoiler:
The Pepp Noble Way to Make and Drink Tea
Pepp's Eye Candy thread
Pepp's First Random Map Script!
avatar
Pepp
Moderator
Moderator

Age : 21
Posts : 5277
Join date : 2011-04-29

Back to top Go down

Re: Need Help in RM scripting

Post by The Dude on Sat 3 Mar 2012 - 17:16

Try removing this line:
Spoiler:
int deer2ID=rmCreateObjectDef("turkey");
int bonusChance=rmRandFloat(0, 1);
rmAddObjectDefItem(deer2ID, "turkey", rmRandInt(4,6), 10.0);
rmSetObjectDefMinDistance(deer2ID, 0.0);
rmSetObjectDefMaxDistance(deer2ID, rmXFractionToMeters(1.0));
rmAddObjectDefConstraint(deer2ID, avoidAll);
rmAddObjectDefConstraint(deer2ID, avoidImpassableLand);
rmSetObjectDefCreateHerd(deer2ID, true);
rmPlaceObjectDefInArea(deer2ID, 0, rmAreaID("team "+i), cNumberNonGaiaPlayers*3);

_________________
Venimus, Vidimus, Deus vincit
-I came, I saw, God conquered-

-Jan III Sobieski upon the victory at Vienna

avatar
The Dude
Administrator
Administrator

Age : 26
Posts : 2935
Join date : 2010-06-03

http://knightsandbarbarians.heavenforum.com

Back to top Go down

Re: Need Help in RM scripting

Post by Pepp on Sat 3 Mar 2012 - 22:17

Thanks, now it is working (I have not tried the nugget3)!

Here is the link to download the latest version (V.02): http://www.4shared.com/zip/fCvJtget/Raja_Ampat_v02.html

NOTE: I copied the readme from Matti's kashmir, :lol:

_________________
Philosophy of gaming: A player is a noobish modder; a modder is a noobish player.

Spoiler:
The Pepp Noble Way to Make and Drink Tea
Pepp's Eye Candy thread
Pepp's First Random Map Script!
avatar
Pepp
Moderator
Moderator

Age : 21
Posts : 5277
Join date : 2011-04-29

Back to top Go down

Re: Need Help in RM scripting

Post by AOE_Fan on Sat 3 Mar 2012 - 23:14

This line:
rmAddObjectDefItem(nugget3, "ypNuggetBoat", 1, 0.0);
should be like this:
rmAddObjectDefItem(nugget3, "Nugget", 1, 0.0);

Treasures always have the same protoname, "Nugget". The level makes it different, the level for sea treasures is indeed 5.


I was wrong, it should be "ypNuggetBoat".
avatar
AOE_Fan
K&B Leader
K&B Leader

Posts : 3615
Join date : 2011-05-27

Back to top Go down

Re: Need Help in RM scripting

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum