Ask a simple question, get a simple answer

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
bongobeat
Posts: 941
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat » Sun Apr 05, 2020 12:13 pm

I got an issue with that monster, it becomes invisible after reloading the savegame. I don't understand why.

I created it based on zimberzimber wisp monster, which has only a particle body.
This one has additional model and particle ratached to the capsule
I added storesourcedata = true to the custom model, but it doesn't change anything to the issue

If you spawn it from the console, all is normal, but if you save, without killing the monster, then reload, the monster is still there but invisible
SpoilerShow

Code: Select all

defineObject{
	name = "quantum_guardian",
	baseObject = "base_monster",
		components = {
		{
			class = "Model",
			model = "assets/models/monsters/medusa.fbx",
			storeSourceData = true,
			enabled = false,
		},
		{
			class = "Animation",
			animations = {
				idle = "assets/animations/monsters/medusa/medusa_idle.fbx",
				moveForward = "assets/animations/monsters/medusa/medusa_walk.fbx",
				strafeLeft = "assets/animations/monsters/medusa/medusa_strafe_left.fbx",
				strafeRight = "assets/animations/monsters/medusa/medusa_strafe_right.fbx",
				turnLeft = "assets/animations/monsters/medusa/medusa_turn_left.fbx",
				turnRight = "assets/animations/monsters/medusa/medusa_turn_right.fbx",
				attack = "assets/animations/monsters/medusa/medusa_attack.fbx",
				gazeAttack = "assets/animations/monsters/medusa/medusa_gaze_attack.fbx",
				getHitFrontLeft = "assets/animations/monsters/medusa/medusa_get_hit_front_left.fbx",
				getHitFrontRight = "assets/animations/monsters/medusa/medusa_get_hit_front_right.fbx",
				getHitBack = "assets/animations/monsters/medusa/medusa_get_hit_back.fbx",
				getHitLeft = "assets/animations/monsters/medusa/medusa_get_hit_left.fbx",
				getHitRight = "assets/animations/monsters/medusa/medusa_get_hit_right.fbx",
				fall = "assets/animations/monsters/medusa/medusa_get_hit_front_left.fbx",
			},
			currentLevelOnly = true,
		},
		{
			class = "Monster",
			meshName = "medusa_mesh",
			hitSound = "warden_hit",
			dieSound = "warden_die",
			hitEffect = "hit_dust",
			deathEffect = "wisp_death",
			capsuleHeight = 0.2,
			capsuleRadius = 0.7,
			health = 500,
			evasion = 0,
			protection = 5,
			exp = 500,
			flying = true,
			immunities = { "sleep", "blinded" },
			resistances = { shock = "immune", cold = "weak", poison = "immune", fire = "weak" },
			traits = { "elemental" },
		},
		{
			class = "UggardianBrain",
			name = "brain",
			sight = 7,
			allAroundSight = true,
			morale = 100,
		},
		{
			class = "MonsterMove",
			name = "move",
			sound = "quantum_guardian_move",
			cooldown = 1.25,
			dashChance = 50,
		},
		{
			class = "MonsterTurn",
			name = "turn",
			sound = "no_sound",
			animationSpeed = 10,
		},
		{
			class = "Timer",
			name = "disrupted",
			timerInterval = 8,
			enabled = true,
			disableSelf = false,
			onActivate = function(self)
				if self.go.brain.seesParty then
					local champion
					for i = 1, math.random(1,4) do
--					for i = 1, 4 do
						champion = party.party:getChampionByOrdinal(i)
						if champion and champion:isAlive() then
							champion:setConditionValue("disrupted", 5)
						end
					end
				end
			end,
		},

		{
			class = "MonsterAttack",
			name = "rangedAttack",
			attackType = "projectile",
			attackPower = 10,
			cooldown = 2,
			repeatChance = 0,
			animation = "attack",
			sound = "no_sound",
			shootProjectile = "lightning_bolt",
			onAttack = function(self)
				local dx,dy = getForward(self.go.facing)
				local x = self.go.x + dx*1
				local y = self.go.y + dy*1
				local spell = spawn("quantum_meteor", self.go.level, x, y, self.go.facing, self.go.elevation)
			end,
--			projectileHeight = 1.3,
--			animationSpeed = 3,
		},
		{
			class = "MonsterChangeAltitude",
			name = "changeAltitude",
			sound = "quantum_guardian_move",
		},
		{
			class = "Light",
			parentNode = "capsule",
			color = vec(2.5, 5, 5),
			brightness = 2,
			range = 3,
			fillLight = true,
		},
		{
			class = "Particle",
			name = "corpse",
			parentNode = "capsule",
	 emitterMesh = "mod_assets/models/strange_device.fbx",
			particleSystem = "force_field_small",
			offset = vec(0,-0.4,0),
		},
		{
			class = "Model",
			name = "forcefield",
			model = "mod_assets/models/strange_device.fbx",
			parentNode = "capsule",
			offset = vec(0,-1,0),
			rotation = vec(0,0,0),
			storeSourceData = true,
		},
		{
			class = "Particle",
			parentNode = "capsule",
			particleSystem = "force_field_small",
			offset = vec(0,-0.75,0),
		},
	},
}
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505

Zo Kath Ra
Posts: 827
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra » Sun Apr 05, 2020 4:56 pm

bongobeat wrote:
Sun Apr 05, 2020 12:13 pm
I got an issue with that monster, it becomes invisible after reloading the savegame.
If you want help, make a small test dungeon that contains only this monster, and upload the Dungeon Editor files.

bongobeat
Posts: 941
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: Ask a simple question, get a simple answer

Post by bongobeat » Mon Apr 06, 2020 12:24 pm

Zo Kath Ra wrote:
Sun Apr 05, 2020 4:56 pm
bongobeat wrote:
Sun Apr 05, 2020 12:13 pm
I got an issue with that monster, it becomes invisible after reloading the savegame.
If you want help, make a small test dungeon that contains only this monster, and upload the Dungeon Editor files.
here is the export and the source:
https://www.dropbox.com/s/mdutklva8bzjz ... s.rar?dl=0

I've run it a try again: Loaded the dungeon dat, saved, reloaded, then the monster is invisible.
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505

kelly1111
Posts: 316
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 » Wed Apr 29, 2020 8:02 pm

I want to make the following. When the party enters a new area. I want a hudprint text to appear in the middle of the screen and the text should be bigger than the standard text. Is such a thing possible?

User avatar
Isaac
Posts: 2943
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac » Thu Apr 30, 2020 5:09 am

There is a GUI text drawing function that can put text anywhere on the screen, but AFAIK, the largest GUI drawn font in Grimrock 2 looks to be the same size as the regular output from hudPrint. So the text could not be made bigger, only smaller.

The alternative is to create your text as an image. There are GUI image drawing functions that can place the image anywhere on the screen.

User avatar
THOM
Posts: 1126
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM » Thu Apr 30, 2020 8:45 am

In ORRR3 we use GrimTK to draw bigger text on the screen. The source files will be released together with the update within the next days.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

kelly1111
Posts: 316
Joined: Sun Jan 20, 2013 6:28 pm

Re: Ask a simple question, get a simple answer

Post by kelly1111 » Thu Apr 30, 2020 5:43 pm

thanks for the reply. I will wait for the source files and have a look.

Zo Kath Ra
Posts: 827
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Ask a simple question, get a simple answer

Post by Zo Kath Ra » Fri May 01, 2020 8:53 pm

1) Create a new dungeon in the editor
2) Press "Play" to start preview mode
3) The party is now at 15/15
4) Enter into the console:
5 < party.x
Result: false
5) Enter into the console:
5 < (party.x)
Result: true

But:
1) Enter into the console:
px = 5
2) Enter into the console:
px < party.x
Result = true

edit:
If you replace < with <= the comparison with a number literal but no parentheses always returns true, e.g.
5 <= party.x

User avatar
KhrougH
Posts: 68
Joined: Tue Sep 04, 2018 11:45 pm
Location: Roma

placing items

Post by KhrougH » Fri Jun 12, 2020 11:31 am

when you drop an item it stand on the ground in a "random" position.
i need to place an object on the ground but just at the center of the tile.
i already Defined my Object but i can't find a way to tell him to place it in the middle of the tile when you drop it. some help?
[...]
All those moments will be lost in time, like tears in rain.
Time to die.

Zo Kath Ra
Posts: 827
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: placing items

Post by Zo Kath Ra » Fri Jun 12, 2020 9:42 pm

KhrougH wrote:
Fri Jun 12, 2020 11:31 am
when you drop an item it stand on the ground in a "random" position.
i need to place an object on the ground but just at the center of the tile.
i already Defined my Object but i can't find a way to tell him to place it in the middle of the tile when you drop it. some help?
Please post the object definition.

Post Reply