Page 5 of 7

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Tue Oct 21, 2014 6:02 am
by [SMUG]Ipecac
Hi guys,

Sorry in advance, but I'm totally "level1" guy with this stuff.

I want to make floor_trigger that puts text on the screen. e.g. you walk into a room and text pops up saying "The room reeks of death." or something like that.

Do i put a trigger down and link it to a script_entity? What do I put in the script box for this simple action?

If you guys can set me on the right path here, I'll be able to extrapolate and come up with some other stuff myself.

Thanks :)

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Tue Oct 21, 2014 6:11 am
by ScroLL

Code: Select all

function reekText()
    hudPrint("The room reeks of death.")
end
Your floor trigger connects to the script entity and should use the reekText function

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Tue Oct 21, 2014 6:19 am
by [SMUG]Ipecac
If I put that

function reekText()
hudPrint("The room reeks of death.")
end

into the script_entity, then link the trigger to the script_entity and select --on activate, target floor_trigger, reekText()-- the text appears on the screen when the player spawns. Trigger does nothing. Am I missing something?

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Tue Oct 21, 2014 6:22 am
by SnowyOwl47
Isaac wrote:
sapientCrow wrote:ok thanks.

I do not understand why they do not allow for the ability to override some of the core rules and formulas more easily.
I do not even see a way to alter attributes or add abilities to items in the editor itself.
I don't understand why they ever would... :?

(They include the mod tools for people to mod what they like in their own maps; but I can't imagine allowing that in their official campaign. They likely balanced the game based on the predicted limits of the PCs.)

**If there is a Party hook for XP gains, then such a hack could probably work in a modded map; but I don't think (certainly don't know) if you can hook to that via console script in the running game; as would have to be done to patch the LoG2 campaign.

*** If there isn't such a hook, it's not a bad thing to ask for in a future patch or one of Petri's glögg sessions.

Once the scripting reference is made public, you could choose to add extra points at times when they level up... If you wanted a 20% xp bonus... just add 20% of their current XP after they level up; or (if possible) add the points directly after they level up, but before you've spent them.
I'm so glad party hooks still work :D

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Tue Oct 21, 2014 6:23 am
by [SMUG]Ipecac
Nevermind, it worked! Thanks!

I placed the trigger under an object haha

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Tue Oct 21, 2014 6:25 am
by SnowyOwl47
[SMUG]Ipecac wrote:If I put that

function reekText()
hudPrint("The room reeks of death.")
end

into the script_entity, then link the trigger to the script_entity and select --on activate, target floor_trigger, reekText()-- the text appears on the screen when the player spawns. Trigger does nothing. Am I missing something?
Make sure nothing like an item or anything is touching the floor_triggure or pressure plate or whatever your using. Once it gets activated by anything you allow it to be activated by its activated. ;)

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Wed Oct 22, 2014 6:16 pm
by zeltak
Is there a way to add onDie trigger to a creature you spawn with a script?

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Wed Oct 22, 2014 6:29 pm
by SnowyOwl47
zeltak wrote:Is there a way to add onDie trigger to a creature you spawn with a script?
Yes you add a connector:

Code: Select all

monster_name.monster:addConnector("onDie", some script, some function)

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Wed Oct 22, 2014 6:38 pm
by zeltak
SnowyOwl47 wrote: Yes you add a connector:

Code: Select all

monster_name.monster:addConnector("onDie", some script, some function)
Thanks.

Re: ~Basic Scripting and Editor Help(Easy Scripting Updated!

Posted: Wed Oct 22, 2014 7:12 pm
by mpuppetier
I guys, how can i kill a monster??
i had tried

Code: Select all

function killWizard()
   wizard_1.monster:destroy();
end
also tried the methods
kill() and dieBastard() :D
and setHeath(0) ...
but the wizard still looking at me :D

-- EDIT --

I found this,

Code: Select all

function killWizard()
   wizard_1:destroy();
end
but it doesn't start the die animation...