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!
Wrathful
Posts: 2
Joined: Sat Feb 10, 2018 2:01 am

Re: Ask a simple question, get a simple answer

Post by Wrathful »

Hey Wrathful,
I usually start any GUI function/script with the following:
Thanks a bunch for the help akroma. Problem solved!

Wrathful
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

Oh Wrathful ! ... I forgot to mention -

If you are drawing text / images from the onDrawAttackPanel hook,

Code: Select all

onDrawAttackPanel = function(self, champion, context, x, y)
you do NOT need to define or multiply anything (coords or measurements) with that "f" factor.
The x and y you are provided in that hook are already adjusted to account for screen resolution
ColdDeadStone
Posts: 24
Joined: Sat Nov 26, 2016 12:12 pm

Re: Ask a simple question, get a simple answer

Post by ColdDeadStone »

Hello! It's time again for a simple question and maybe a simple answer! Maybe someone knows more about it:

I use a different camera for various things and obviously it was always coincidental that my Camera was always oriented to the North, so I've never had a problem... but now the Camera should look to the East and in a 45 degree angle downwards and that causes problems!

Code: Select all

spawn("mycam",party.level,14,20,1,6,"easttestcam")
easttestcam.camera:setFov(101)
easttestcam:setWorldRotationAngles(-45, 0, 0)
GameMode.setCamera(easttestcam.camera)
GameMode.setGameFlag("HideGui",true)
Now the problem is that when you set the rotation the Camera is pointing North again! The angle works like it should, but in the wrong direction. Every attempt to align the Camera to the East again will result in an angle of 0 again :? hmm...

Any help or explanation is welcome! Okay thanks for reading... have a nice day! :)
Sorry for my poor english... hope you understand what i try to say! :)
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

Have you tried (0,-90,0)?

Code: Select all

 easttestcam:setWorldRotationAngles(0,-90, 0)
*I don't know the specifics of your map, but -90 in the 2nd axis, rotates the camera to East for me.

___________

Code: Select all

spawn("mycam",party.level,15,15,0,0,"easttestcam"):setWorldPositionY(1.5)
increment = {0,0,0,0}
function spin()
	easttestcam.camera:setFov(101)
	easttestcam:setWorldRotationAngles(unpack(increment))
	print(unpack(increment))
	increment[2] = increment[2] -10
end	
self.go:spawn("timer").timer:addConnector("onActivate", self.go.id,"spin")
GameMode.setCamera(easttestcam.camera)
GameMode.setGameFlag("HideGui",true)
**For anyone else running this script, you need to define a 'mycam' object first; usually put in objects.lua.
SpoilerShow

Code: Select all

defineObject{
	name = "mycam",
	baseObject = "base_floor_decoration",
	components = {
		{
			class = "Camera"		
		}
	},
}
Last edited by Isaac on Sat Feb 24, 2018 5:16 pm, edited 1 time in total.
ColdDeadStone
Posts: 24
Joined: Sat Nov 26, 2016 12:12 pm

Re: Ask a simple question, get a simple answer

Post by ColdDeadStone »

Isaac wrote:Have you tried (0,-90,0)?

Code: Select all

 easttestcam:setWorldRotationAngles(0,-90, 0)
No I didn't, but that's the solution... Quite simple... just:

Code: Select all

easttestcam:setWorldRotationAngles(-45,-90, 0)
Now, the Second zero explains why the Camera is always looking north... :roll: Thanks alot for your help :P
Sorry for my poor english... hope you understand what i try to say! :)
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

Hey All,
does anyone have any suggestions on the best way to keep a real time record of which Weapon Sets each champion currently has active??
Ta! Akroma
User avatar
Isaac
Posts: 3185
Joined: Fri Mar 02, 2012 10:02 pm

Re: Ask a simple question, get a simple answer

Post by Isaac »

akroma222 wrote:Hey All,
does anyone have any suggestions on the best way to keep a real time record of which Weapon Sets each champion currently has active??
Ta! Akroma
What is the exact intention?

Is this meant for creating a one-click—equip, weapon set?
Is this meant for tracking if it's a set? To detect an equipped weapon set, like a Katana, and Wakizashi.

Or are you mimicking the original UI weapon-swap behavior in your own custom UI?
If it is this... I had some success with using more than one party component for inventory management. It let me put several items in a second inventory until needed, with no risk of them dropping on the ground in cases of a full inventory. I used this to swap the arbitrary equipped weapons & items in hand whenever a tiger form potion was used, and to restore them back, once the effect ended.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: Ask a simple question, get a simple answer

Post by akroma222 »

Isaac wrote: Or are you mimicking the original UI weapon-swap behavior in your own custom UI?
If it is this... I had some success with using more than one party component for inventory management. It let me put several items in a second inventory until needed, with no risk of them dropping on the ground in cases of a full inventory. I used this to swap the arbitrary equipped weapons & items in hand whenever a tiger form potion was used, and to restore them back, once the effect ended.
More than one party component..? Second Inventory...?? Im intrigued ;)
Im not sure if that's what Im after though, I only need to check what items are in what slots and then draw them accordingly (the normal inventory is hidden underneath)
I do need to be able to check which Weapon Set is active - for example - so I can switch / draw the hand slot frames properly
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Ask a simple question, get a simple answer

Post by AndakRainor »

Hey! I did a shop GUI with switchable hand slots, mimicking the base GUI. That said I never found how to track if the hands set of the default GUI was set 1 or set 2. But is it really that important if you can switch them in your own GUI ? At worst the shown set number will be inverse when the player leaves the shop :roll:
User avatar
Mysterious
Posts: 226
Joined: Wed Nov 06, 2013 8:31 am

Re: Ask a simple question, get a simple answer

Post by Mysterious »

Hi all.

My mod is rather big and im using (4gb_patch) on the grimrock2.exe file so the Ram is increased to 4GB useage instead of what Grimrock 2 uses as standard. What I want to know is am I allowed to add the patched grimrock2.exe along with my mod? Or do I add the (4gb_patch) with my mod in the zip file?

Then if the later ill have to tell the user of my mod that they should make a back-up of their original (grimrock2.exe) and run the patch and then use the new grimrock2.exe.

PS: I don't want any copyright issues.
Post Reply