Page 348 of 396

Re: Ask a simple question, get a simple answer

Posted: Sun Apr 05, 2020 12:13 pm
by bongobeat
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),
		},
	},
}

Re: Ask a simple question, get a simple answer

Posted: Sun Apr 05, 2020 4:56 pm
by Zo Kath Ra
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.

Re: Ask a simple question, get a simple answer

Posted: Mon Apr 06, 2020 12:24 pm
by bongobeat
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.

Re: Ask a simple question, get a simple answer

Posted: Wed Apr 29, 2020 8:02 pm
by kelly1111
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?

Re: Ask a simple question, get a simple answer

Posted: Thu Apr 30, 2020 5:09 am
by Isaac
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.

Re: Ask a simple question, get a simple answer

Posted: Thu Apr 30, 2020 8:45 am
by THOM
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.

Re: Ask a simple question, get a simple answer

Posted: Thu Apr 30, 2020 5:43 pm
by kelly1111
thanks for the reply. I will wait for the source files and have a look.

Re: Ask a simple question, get a simple answer

Posted: Fri May 01, 2020 8:53 pm
by Zo Kath Ra
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

placing items

Posted: Fri Jun 12, 2020 11:31 am
by KhrougH
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?

Re: placing items

Posted: Fri Jun 12, 2020 9:42 pm
by Zo Kath Ra
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.