Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Deon

#1
Hello. I blatantly wrote to  Jecrell to ask about this, but I would like to ask here too.
A new modder here, I studied XML of the game already so I have no issue adding things into the game, but I need to learn how to make incidents now to make somewhat interesting mods.

My first one is aliens/predator mod, so it does need some coding to add the features like alien attacks and predator spawning.


I am currently struggling with basic stuff: how to spawn a pack of pawns of some kind and make them attack the colony through an incident.

If I understand correctly, from what I've seen in Jecrells' code, I need:
1) Make a variable for a PawnKind which find the PawnKind from XML:
varKind = PawnKindDef.Named("Xenomorph");
2) Make a variable for a faction to assign the pawn to:
varFac = Find.FactionManager.FirstFactionOfDef(FactionDef.Named("Aliens"));
3) Make a variable out of PawnGenerator class to get the pawn itself:
varPawn = PawnGenerator.GeneratePawn(varKind, varFac);

Now I just need to force it to find a suitable spawn location and spawnpawns there.


public override bool TryExecute(IncidentParms parms)
{
       <variable declaration>
       FindSpawnLoc(parms); // locate where to spawn creatures
       SpawnAliens(parms); // call the function to spawn the aliens
}


This is where I run into issues.
Jecrell seems to use:
iwLoc       = CellFinder.RandomClosewalkCellNear(parms.spawnCenter, 8);
https://ludeon.com/forums/index.php?topic=26373.msg266952#msg266952

However my compiler complains that CellFinder.RandomClosewalkCellNear needs 3 parameters and "map" is missing from those.
Can someone help me to figure out why it works for Jecrell and my compiler does not work with it? I can find the definition of this in the metadata:
public static IntVec3 RandomClosewalkCellNear(IntVec3 root, Map map, int radius);

So there seems to be 3 parameters. I have no idea how to get the "Map" to pass to it. Am I doing something completely wrong? I hope that my concern is understood :). Thank you in advance.


P.S. A secondary question would be how to make the pawns of a "manhunter" type. I assume there's a simple variable you can flick, but I could not find where to look for it. Is there a "full source code" somewhere I can look up?
#2
Unfinished / [A16] [WIP] Aliens vs Predator
January 07, 2017, 10:27:29 AM

I have started slowly composing together a mod which implements xenomorphs and predators in to Rimworld universe.
The progress is slow since this is my first mod. I figured out how to add xenos to the game and make them spawn naturally.

The base spritework is done:

Warrior:


Runner:


Queen (WIP):


So far they are based on megaspider and do not have a unique body yet, but they work well in the game already as enemy pawns.



It will take a while since I just learn to mod, but I promise to playtest it and deliver it in a working form.
If someone who already knows modding well is willing to help with minor stuff (template for incident for example), I would greatly appreciate it.

To do (development order):

- Create sprites for xenomorphs.
- Make a pawn for xenormorphs.
- Create ranged "acid" natural weapon.
- Create an incident.
- Create sprites and make different types of xenomorphs (warrior, runner, queen etc).

- Create custom body.
- Create custom AI for aliens.
- Create sprites for predator.
- Create sprites for predator mask/spear.
- Figure out how to make predators/aliens invisible until colonists encounter them.