Jump to content
DarkMatters Celebrates
19 Years of Wyntertyde in Ancaria

From the Sacred 2 Christmas Island Soundtrack
Click to Open Player!

Oppoa16

Sacred 2 - How to Create a Male High Elf?

Recommended Posts

On 6/15/2024 at 1:13 PM, Lindor said:

Currently I don't have the time, but I have seen it and I will answer in the future

Hello @Lindor Don't worry, I know how to do it.

If at any time you need that information, I could tell you.

Thank you very much for your help and patience!

All the best

 

Link to comment
Posted (edited)

Hi @Lindor, I'm trying to enable the use of 2-handed weapons for the Temple Guard.

Do you know if it can be done with the Scrpips? Or is it a more complex process like putting 2 handed weapons on the High Elf?

Thank you very much and best regards!

EDIT:

I have seen in a previous post that Flix already commented that it is only possible to do it at the code level....

So I won't be able to do that.

All the best!

 

Edited by Oppoa16
  • Like! 1
Link to comment
Posted (edited)
On 5/25/2024 at 3:48 PM, Flix said:

That's right, we got the High Elf dual wielding (I have yet to release my version of it) but it requires working in the assembly coding language in OllyDBG which is beyond me.

I can't think of a way it could be feasible, honestly. Even when I've made mods to "replace" characters, I only re-skinned the existing ones, never swapped in a different gender/model.

The biggest hurdle is going to be equipment, specifically getting around the "weargroup" restrictions. You will see "weargroup" in itemtype.txt on every item and character. If you replaced the High Elf with the Shadow Warrior model (or any other model), the High Elf equipment would no longer fit, but it would be the only thing you could equip. Therefore you would either have to:

1) make all High Elf armor invisible by erasing all the textures. This way you could continue to equip it but the "base look" would be all you continue to see (good if you want to replace the High Elf with an NPC model that has armor already)

or

2) change all the models of High elf armor in itemtype.txt to point to the Shadow Warrior armor instead, also updating any surface entries so that they display correctly.

I would never ever do it this way. I advise to leave the zipped graphics files alone, if you need to overwrite something, instead put the new files in loose folders in the "pak" folder that mimic the original folder structure.

So for example you could place files in "pak/mq/maps/heroes/driade/default" if you wanted to override those files. You'd still have to rename each file though.

An even better way would be to just replace the model reference in itemtype.txt. Let's say you want the High Elf to look like the Dryad, while still keeping the existing Dryad character separate and functional.

You would edit the High Elf's itemtype entry:

newItemType = {
	-- standard info
	renderfamily = "RENDERFAM_CREATURE",
	family       = "FAMILY_CREATURE",
	subfamily    = "SUBFAM_LIFE_HIGHELF",
	classification = "CLF_DEFAULT",
	flags        = "FLAG_HASHAIR + FLAG_HASBLINKANIM + FLAG_HASSOUND + FLAG_HASPREVIEWIMAGE + FLAG_NO_ANIM_OPTIMIZATION",
	weargroup    = "WEARGROUP_HIGHELVE",
	-- 3d model + animation info
	model0Data = {
	  name         = "models/heroes/highelve/a_helve.GR2", -- Change this line
	  user         = "WEARGROUP_INVALID",
	},
	-- logic bounding box
  logicBox = {
    minx=-9.377, miny=-14.977, minz=-0.029, 
    maxx=6.852, maxy=8.3, maxz=68.139, 
	},
	dangerclass   = 0,
}
mgr.typeCreate(5, newItemType);

The "name" line you would change to this:

name         = "models/heroes/dryadin/u_dryadin.GR2",

You would also need to update the hairstyles in creatureinfo.txt.

 

I always recommend to go the scripting route rather than to overwrite graphics files whenever possible.

 

Hi @FLix In the following post, you comment on the following:

"1) make all High Elf armor invisible by erasing all the textures. This way you could continue to equip it but the "base look" would be all you continue to see (good if you want to replace the High Elf with an NPC model that has armor already)"

My question is where can I find those textures for Can I delete them?

@Lindor I don't know if you would know that too?

As always, thank you very much for your help!

 

Edited by Oppoa16
  • Like! 1
Link to comment
Posted (edited)
On 6/22/2024 at 11:13 PM, Lindor said:

Oh, no te preocupes, lo sé.

Yo iría por esta ruta:
itemtype.txt->weargroup->itemtype->model->surface->surface.txt->texture

Primero que todo necesitas tomar una decisión. Si estás bien con usar siempre la misma armadura en el juego, entonces no hay necesidad de eliminar todas las texturas para todos los objetos de armadura de alto elfo, solo necesitas eliminar las texturas de aquellos objetos que quieres usar en el juego. Es posible  forzar la eliminación de un objeto .
Sin embargo, si quieres una experiencia de juego fluida, no hay forma de evitar eliminar todas las texturas de todos los objetos que posiblemente puedas manejar.
Pero hay un problema: no todos los objetos son weargroup de un solo héroe. Hay objetos con, por ejemplo, WEARGROUP_DEFAULT que hace referencia a una lista codificada; no es posible saber qué héroes se supone que pueden manejar el objeto sin conocimiento dentro del juego sobre el objeto o conocimiento sobre los archivos dll.



Debes iterar sobre todos los tipos de elementos con WEARGROU_HIGHELVE y todos los tipos de elementos con WEARGROUP_DEFAULT que contienen elementos de armadura que pueden ser usados por el elfo noble.

Sacred 2 usa el formato granny 2 para guardar modelos 3D. Este formato de datos contiene información sobre el nombre de la superficie que espera el modelo.
Para tu propósito podemos categorizar los tipos de elementos en dos grupos: los que sobrescriben sus superficies y los que no.
Para el primer tipo es fácil encontrar la superficie ya que está literalmente escrita en itemtype.txt:
 

 
	      
	       
	
	  
	 

"helve-pear-helmet_a" es la superficie que el modelo espera y se sobrescribe con "helve-ninehells-helmet_a". Buscando en surface.txt, Ejemplo :
 

      

Estos son los nombres de texturas para este tipo de elemento. Son fáciles de encontrar. Sin embargo, hay muchos elementos cuyas superficies no se sobrescriben, por ejemplo:

 
	      
	   
	
	  
	 

Para estos elementos, necesitas que GrannyViewer averigüe qué superficie espera el modelo.
Ya te enlacé a una publicación mía que contiene un enlace a una versión de GrannyViewer en una publicación anterior. Para citarme a mí mismo:

Parece que no leíste esto porque luego me preguntaste esto:

Simplemente ve y consíguelo, el enlace está ahí mismo.:)

 

Hello @Lindor! Thank you very much for your answer!!

It has been very complete. Now I have a little free time again and I'm going to get back to this project.

If I made the decision to always use the same armor in the game, then which line should I delete, in the following example?

image.png.25f9ae05bfab102051c4835135a962e2.png

 

As I always tell you, thank you very much for all your help and time, thanks to you I am learning many things. all the best!

 

 

Edited by Oppoa16
  • Like! 1
Link to comment
On 7/11/2024 at 9:58 PM, Oppoa16 said:

 

Hello @Lindor! Thank you very much for your answer!!

It has been very complete. Now I have a little free time again and I'm going to get back to this project.

If I made the decision to always use the same armor in the game, then which line should I delete, in the following example?

image.png.25f9ae05bfab102051c4835135a962e2.png

 

As I always tell you, thank you very much for all your help and time, thanks to you I am learning many things. all the best!

 

 

No line.

I think to make armor invisible I think the easiest and most reliable way would be to erase the textures.
Firstly, make a texture that is pure alpha 0. Alpha means the alpha channel of rgba colors which controls transparency. Basically create an invisible texture. You can e.g. use GIMP for that.
Secondly, go to surface.txt and search for `"helve-ninehells-helmet_a"`. There you get the name of the textures: ``
 

newSurface = {
  name         = "helve-ninehells-helmet_a",
  texture0Name = "maps/heroes/highelve/sets/ninehells/a_helve-ninehells-helmet_d.tga",
  texture1Name = "maps/heroes/highelve/sets/ninehells/a_helve-ninehells-helmet_sg.tga",
  texture2Name = "maps/heroes/highelve/sets/pearl/a_helve-pearl-helmet_n.tga",
  texture3Name = "fx/lava_fx.tga",
  flags        = SURFACE_FLAG_MASKED + SURFACE_FLAG_DOUBLESIDED,
  shader       = obj_fx_lava,
}
mgr.surfCreate(newSurface);

In your mod's pak folder, go to the three folder paths for each textureXName and paste your invisible texture there. Rename the texture according to the texture name found in surface.txt.
Thirdly, repeat the same process for `"helve-ninehells-helmet-fx_a""`.

There would be two other ways to do it, one which would involve creating a shader collection with only null.shader and using said shader collection in your two surface.txt's shader entries, and the other way would be just to delete the texturexName entries from the surfaces. But I have never done any of that and knowing th game's somewhat unexpected behaviours sometimes, I think making the textures invisible would be the more reliable method as this woks for sure.

  • Like! 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
  • Create New...