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!
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Ask a simple question, get a simple answer

Post by cromcrom »

Hey elevenwarrior,

you might check the onProjectileHit from the Projectile component, it might do the trick, as it seems to be calling both the projectile (so you can destroy it ) and the thing it hit ( so you can decrement if it is valid).
A trip of a thousand leagues starts with a step.
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Ask a simple question, get a simple answer

Post by cromcrom »

is there a "keyPressed" component thing ? Because the "keyDown" fires my functions repeatidly :-(
A trip of a thousand leagues starts with a step.
User avatar
Modraneth
Posts: 95
Joined: Thu Aug 27, 2015 8:27 pm
Location: Portugal

Re: Ask a simple question, get a simple answer

Post by Modraneth »

hi,
-its possible to create skills ??
i want to make a skill which allow the mino race to dual welding 2 heavy weapons but with a decrease on accuracy.
-its possible to create new races?
creating dwarfs, lizardmens and undead, i have some ideias to make special skills for this races.
Mods:
Isle of Gunger
The Bloody Path Dropped
A World of Power work in progress
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Ask a simple question, get a simple answer

Post by minmay »

cromcrom wrote:is there a "keyPressed" component thing ? Because the "keyDown" fires my functions repeatidly :-(
Just store and check whether the key was down on the previous frame.
Modraneth wrote:-its possible to create skills ??
i want to make a skill which allow the mino race to dual welding 2 heavy weapons but with a decrease on accuracy.
Yes, but changing dual wielding rules like this would require a lot of hacks, so I don't recommend it.
Modraneth wrote:-its possible to create new races?
Yes.
Look for defineSkill and defineRace in http://www.grimrock.net/modding/scripting-reference/.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: Ask a simple question, get a simple answer

Post by cromcrom »

I have no idea how to do this, beside delayedcall. but never mind, I will find a way around. I understand your will to have people look around and search by themselves so they can improve, but being a good teacher also means adapting , at least a little bit, to the people you want to instruct.
Not every body is a pro coder, or knows the forum by heart to know exactly where to look for informations.
Again, nevermind.
A trip of a thousand leagues starts with a step.
User avatar
Modraneth
Posts: 95
Joined: Thu Aug 27, 2015 8:27 pm
Location: Portugal

Re: Ask a simple question, get a simple answer

Post by Modraneth »

Modraneth wrote:-its possible to create skills ??
i want to make a skill which allow the mino race to dual welding 2 heavy weapons but with a decrease on accuracy.
Yes, but changing dual wielding rules like this would require a lot of hacks, so I don't recommend it.
Modraneth wrote:-its possible to create new races?
Yes.
Look for defineSkill and defineRace in http://www.grimrock.net/modding/scripting-reference/.[/quote]

thank you
Mods:
Isle of Gunger
The Bloody Path Dropped
A World of Power work in progress
User avatar
Modraneth
Posts: 95
Joined: Thu Aug 27, 2015 8:27 pm
Location: Portugal

Re: Ask a simple question, get a simple answer

Post by Modraneth »

thank you
i will check it
Mods:
Isle of Gunger
The Bloody Path Dropped
A World of Power work in progress
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Really a simple question but it drives me mad:

I want to add a timer component to the party object which starts NOT at the beginning of the game. Cannot find a command to disable it. I am pretty sure it is very obvious but I am unable to figure it out.

Any help, please?
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Ask a simple question, get a simple answer

Post by Azel »

When you declare the Timer, you can't just say, MyPartyTimer.timer:disable() ??
User avatar
THOM
Posts: 1274
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Ask a simple question, get a simple answer

Post by THOM »

Sadly not.

Ah, and it's not a component to the party, as I mentioned before, but to an object.

That's what I got so far:

Code: Select all

    		{
     			class = "Timer",
      			name = "movetimer",
      			timerInterval = 0.02,
			--timer = "disable",
			--self.go.timer:stop(),
      			onActivate = function(self)
        			self.go.movescript.moveThat()
      			end,
    		},
the two deactivated lines show some of my trials which didn't work...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
Post Reply