Jump to content


Photo

More Questions


20 replies to this topic

#1 CoM_Solaufein

CoM_Solaufein

    213374U

  • Members
  • 382 posts
  • Gender:Male
  • Location:The Frozen North

Posted 04 June 2011 - 02:43 PM

I've seen some mods use something called a hot key fixer in scripts, what is that?


RealSetGlobalTimer is that our real time or is it game time?
Posted Image

"Magically Enhancing the IE Games" since 2001.

Web site
The Undying BG2 mod!
CoM Portraits!

#2 berelinde

berelinde

    The Typo Queen

  • Gibberlings
  • 8594 posts
  • Location:New Jersey, USA

Posted 04 June 2011 - 03:19 PM

Hotkey fixer is something to fix strings if something gets a bit scrambled.

Example:
IF 
	HotKey(K)  
THEN 
	RESPONSE #100	   
		SetName(~Gavin~) 
		SetPlayerSound(Myself,~Um, regroup?~ [BGAV_01],MORALE) 
		SetPlayerSound(Myself,~The gods will smile on our actions. We are surely on the right path.~ [BGAV_02],HAPPY) 
		SetPlayerSound(Myself,~We must do better.~ [BGAV_03],UNHAPPY_ANNOYED) 
		SetPlayerSound(Myself,~We cannot go on like this! I cannot condone our actions.~ [BGAV_04],UNHAPPY_SERIOUS) 
		SetPlayerSound(Myself,~This must end. I can no longer be party to such deeds.~ [BGAV_05],UNHAPPY_BREAKING_POINT)
		SetPlayerSound(Myself,~Remember, you asked for this.~ [BGAV_06],LEADER)
		SetPlayerSound(Myself,~I need to rest. I'm no good to anyone like this.~ [BGAV_07],TIRED) 
		SetPlayerSound(Myself,~If we're going to stand around and look at the scenery, I'm going to get out my sketchbook.~ [BGAV_08],BORED) 
		SetPlayerSound(Myself,~In Lathander's name!~ [BGAV_09],BATTLE_CRY1) 
		SetPlayerSound(Myself,~By all that is good, I will crush you!~ [BGAV_10],BATTLE_CRY2) 
		SetPlayerSound(Myself,~To battle!~ [BGAV_11],BATTLE_CRY3) 
		SetPlayerSound(Myself,~Fall before the might of Lathander!~ [BGAV_12],BATTLE_CRY4) 
		SetPlayerSound(Myself,~Hey, I felt that!~ [BGAV_13],DAMAGE) 
		SetPlayerSound(Myself,~It's as good a time as any.~ [BGAV_14],DYING) 
		SetPlayerSound(Myself,~This healer needs some help, here!~ [BGAV_15],HURT) 
		SetPlayerSound(Myself,~All this fresh air really makes me feel alive.~ [BGAV_16],AREA_FOREST) 
		SetPlayerSound(Myself,~So many opportunities to help, but so many people who need it.~ [BGAV_17],AREA_CITY) 
		SetPlayerSound(Myself,~There's nothing between me and the open sky but a lot of rock and dirt.~ [BGAV_18],AREA_DUNGEON) 
		SetPlayerSound(Myself,~Daylight! Behold the majesty of Lathander!~ [BGAV_19],AREA_DAY) 
		SetPlayerSound(Myself,~At night, the world rests and is renewed.~ [BGAV_20],AREA_NIGHT) 
		SetPlayerSound(Myself,~Your wish?~ [BGAV_21],SELECT_COMMON1) 
		SetPlayerSound(Myself,~Yes?~ [BGAV_22],SELECT_COMMON2) 
		SetPlayerSound(Myself,~Hmm?~ [BGAV_23],SELECT_COMMON3) 
		SetPlayerSound(Myself,~How may I help you?~ [BGAV_24],SELECT_COMMON4) 
		SetPlayerSound(Myself,~Your request?~ [BGAV_25],SELECT_COMMON5) 
		SetPlayerSound(Myself,~What was it that you wanted?~ [BGAV_26],SELECT_COMMON6) 
		SetPlayerSound(Myself,~As you wish.~ [BGAV_27],SELECT_ACTION1) 
		SetPlayerSound(Myself,~I will do as you say.~ [BGAV_28],SELECT_ACTION2) 
		SetPlayerSound(Myself,~At your command.~ [BGAV_29],SELECT_ACTION3) 
		SetPlayerSound(Myself,~All right.~ [BGAV_30],SELECT_ACTION4) 
		SetPlayerSound(Myself,~Yes.~ [BGAV_31],SELECT_ACTION5) 
		SetPlayerSound(Myself,~As you see fit.~ [BGAV_32],SELECT_ACTION6) 
		SetPlayerSound(Myself,~Consider it done.~ [BGAV_33],SELECT_ACTION7) 
		SetPlayerSound(Myself,~As long as it doesn't involve spiders.~ [BGAV_34],SELECT_RARE1) 
		SetPlayerSound(Myself,~Is this really necessary?~ [BGAV_35],SELECT_RARE2) 
		SetPlayerSound(Myself,~One for Lathander!~ [BGAV_36],CRITICAL_HIT) 
		SetPlayerSound(Myself,~Damn my clumsiness!~ [BGAV_37],CRITICAL_MISS) 
		SetPlayerSound(Myself,~Sorry, but there's no room for anything else.~ [BGAV_39],INVENTORY_FULL) 
		SetPlayerSound(Myself,~Was that really necessary?~ [BGAV_40],PICKED_POCKET) 
		SetPlayerSound(Myself,~I am hidden.~ [BGAV_41],HIDDEN_IN_SHADOWS) 
		SetPlayerSound(Myself,~Stop that! You've broken my concentration.~ [BGAV_42],SPELL_DISRUPTED) 
		SetPlayerSound(Myself,~Let's hope this gets the right target, shall we?~ [BGAV_43],SET_A_TRAP) 
END

RealSetGlobalTimer() uses real time (in seconds), not game time. It will probably still show up looking screwed up if you look at the script with NI after it compiles, but that's just the usual NI misinterpretation and nothing to worry about. RealSetGlobalTimer("MyTimer","GLOBAL",300) will still expire in 5 minutes real time, no matter what NI says.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#3 Ardanis

Ardanis

    A very GAR character

  • Members
  • 2221 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 04 June 2011 - 04:01 PM

It will probably still show up looking screwed up if you look at the script with NI after it compiles, but that's just the usual NI misinterpretation and nothing to worry about. RealSetGlobalTimer("MyTimer","GLOBAL",300) will still expire in 5 minutes real time, no matter what NI says.

If you mean "300" transforming into "ONE_HOUR" then it's due to IDS, which is usually using descriptions in accordance with in-game timing. The "300"might as well be labeled as THREE_HUNDRED_SECONDS_OF_REAL_TIME_OR_ONE_HOUR_OF_INGAME_PLAYTIME
"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#4 devSin

devSin
  • Fixpackers
  • 3017 posts
  • Gender:Male

Posted 04 June 2011 - 06:48 PM

We do what the IDS tells us IIRC. If it decompiles to a game time symbol for you, it's because your Action.ids says this parameter uses symbols from that IDS, not because it's our "usual misinterpretation."

#5 CoM_Solaufein

CoM_Solaufein

    213374U

  • Members
  • 382 posts
  • Gender:Male
  • Location:The Frozen North

Posted 04 June 2011 - 11:19 PM

Great thanks.

Another question in regards to romances when the variable is set to 3 as in Global("AnomenRomanceActive","GLOBAL",3) that means the romance is killed?
Posted Image

"Magically Enhancing the IE Games" since 2001.

Web site
The Undying BG2 mod!
CoM Portraits!

#6 Ardanis

Ardanis

    A very GAR character

  • Members
  • 2221 posts
  • Gender:Male
  • Location:Saint-Petersburg, Russia

Posted 05 June 2011 - 06:48 AM

That's the most common template, yes. Of mods deviating from this standart, there's Imoen romance, which uses 4 for the 'end' value.
"Uguu~ Boku Ayu."

Before you start breaking wall tiles with your bare fists, ask yourself first - do you truly need it?

#7 CoM_Solaufein

CoM_Solaufein

    213374U

  • Members
  • 382 posts
  • Gender:Male
  • Location:The Frozen North

Posted 09 January 2012 - 02:10 PM

Is there a difference between <HESHE> and <PRO_HESHE>, <HIMHER> and <PRO_HIMHER> and so forth when it comes to none PRO and PRO_something?
Posted Image

"Magically Enhancing the IE Games" since 2001.

Web site
The Undying BG2 mod!
CoM Portraits!

#8 berelinde

berelinde

    The Typo Queen

  • Gibberlings
  • 8594 posts
  • Location:New Jersey, USA

Posted 09 January 2012 - 04:05 PM

<HESHE> will use the pronoun appropriate to the person the NPC is speaking to. <PRO_HESHE> will use the pronoun appropriate to Player1.

If the male protagonist is a squishy mage, the player may put Jaheira in the first party slot. If the player then clicks on your NPC, if you use <HESHE>, the NPC will refer to Jaheira as she. If you use <PRO_HESHE>, the NPC would refer to her as he.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#9 CoM_Solaufein

CoM_Solaufein

    213374U

  • Members
  • 382 posts
  • Gender:Male
  • Location:The Frozen North

Posted 23 January 2012 - 12:57 AM

Okay now I'm moving on to more complicated scripting. I have five tests for the character to take on and finish. Each of these tests takes place in a separate area and when they finish they return to the home area where they started from. There's a guide who I want to greet the party once they finish the quest to help them along for the next test.

So lets say encounter A is done and the group returns to the home area. I want to guide to go to the entrance of the area where encounter A started from. Now they get the low down for encounter B, so the party goes to the exit for encounter B. Once they finish encounter they return and I want the guide to be at the doorway of encounter B when they return.

I know this has something to do with having the creature move or walk to a certain point in the area. I just don't know how to set it up.

Edited by CoM_Solaufein, 23 January 2012 - 01:56 AM.

Posted Image

"Magically Enhancing the IE Games" since 2001.

Web site
The Undying BG2 mod!
CoM Portraits!

#10 Kaeloree

Kaeloree

    beluga

  • Modders
  • 827 posts
  • Gender:Male

Posted 23 January 2012 - 01:44 AM

MoveToPoint([x.y]) is probably what you're looking for. :)

#11 berelinde

berelinde

    The Typo Queen

  • Gibberlings
  • 8594 posts
  • Location:New Jersey, USA

Posted 23 January 2012 - 03:56 AM

MoveToPoint() works, but the CRE has to walk the whole way. If you want the NPC to be standing there as soon as the party enters the area, you are better off putting something like the following in the area script.

IF
Global("TestADone","GLOBAL",1)
Exists(Player1)
THEN
RESPONSE #100
ActionOverride("questgvr",JumpToPoint([x.y]))
SetGlobal("TestADone","GLOBAL",2)
END

Edited by berelinde, 23 January 2012 - 06:02 AM.

Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#12 DavidW

DavidW
  • Gibberlings
  • 4112 posts
  • Gender:Male

Posted 23 January 2012 - 05:28 AM

For the sake of keeping your code modular and manageable, you could consider having each version of the quest-giver be a separate CRE file. In that case, you get the area file to create the creature when and where you need them, and give each incarnation a script telling it to destroy itself if its bit of the quest has been done.

#13 Miloch

Miloch

    Barbarian

  • Modders
  • 4715 posts
  • Gender:Male
  • Location:At Large

Posted 23 January 2012 - 07:49 PM

If you did it that way, you'd also want to make sure the alternative CREs DestroySelf()ed if another incarnation had been killed (and/or make them unkillable).

MoveToPoint/JumpToPoint only work in the same area IIRC. If you're actually moving between separate areas, you'll need EscapeAreaMove() or MoveBetweenAreas() to move the CRE between different areas (unless you go with destroying and recreating the CREs).

Edited by Miloch, 23 January 2012 - 08:24 PM.

Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#14 CoM_Solaufein

CoM_Solaufein

    213374U

  • Members
  • 382 posts
  • Gender:Male
  • Location:The Frozen North

Posted 17 April 2012 - 02:48 PM

Thanks. I'll go with the different creature files with each greeting.

From a scripting point of view is it better to have the CreateCreature() scripts at the bottom or the top?


IF
OnCreation()
Global("Reveal7400","CM7400",0)
THEN
RESPONSE #100
  SetGlobal("Reveal7400","CM7400",1)
  Explore()
  Continue()
END
IF
Global("CmEncounterYQuests","GLOBAL",0)
THEN
RESPONSE #100
  TriggerActivation("Tran7300",FALSE)
			    TriggerActivation("Tran7402",FALSE)
  TriggerActivation("Tran7403",FALSE)
  TriggerActivation("Tran7404",FALSE)
  TriggerActivation("Tran7405",FALSE)
  TriggerActivation("Tran7500",FALSE)
  Continue()
END
IF
Global("CmEncounterYQuests","GLOBAL",1)
THEN
RESPONSE #100
  TriggerActivation("Tran7402",TRUE)
  Continue()
END
IF
Global("CmEncounterYQuests","GLOBAL",2)
THEN
RESPONSE #100
  TriggerActivation("Tran7403",TRUE)
  Continue()
END
IF
Global("CmEncounterYQuests","GLOBAL",3)
THEN
RESPONSE #100
  TriggerActivation("Tran7404",TRUE)
  Continue()
END
IF
Global("CmEncounterYQuests","GLOBAL",4)
THEN
RESPONSE #100
  TriggerActivation("Tran7405",TRUE)
  Continue()
END
IF
Global("CmEncounterYQuests","GLOBAL",5)
THEN
RESPONSE #100
  TriggerActivation("Tran7500",TRUE)
  Continue()
END
IF
Dead("cmdeath1")
THEN
RESPONSE #100
  CreateCreature("CM7400G1",[580.845],11)
END
IF
Dead("cmdeath2")
THEN
RESPONSE #100
  CreateCreature("CM7400G2",[484.1554],9)
END
IF
Dead("cmdeath3")
THEN
RESPONSE #100
  CreateCreature("CM7400G3",[1631.2534],9)
END
IF
Dead("cmdeath4")
THEN
RESPONSE #100
  CreateCreature("CM7400G4",[3595.1020],3)
END
IF
Dead("cmdeath5")
THEN
RESPONSE #100
  SetGlobal("CmEncounterYQuestsComplete","GLOBAL",1)
END
IF
Global("CmEncounterYQuestsComplete","GLOBAL",1)
	    Global("CmxxEndGame","CM7400",0)
THEN
RESPONSE #100
  SetGlobal("CmxxEndGame","CM7400",1)
  CreateCreature("CMxx",[1992.930],0)
  CreateCreature("CM7400S3",[1946.854],3)
  CreateCreature("CM7400S3",[1848.961],4)
  CreateCreature("CM7400S2",[1927.830],2)
  CreateCreature("CM7400S2",[1876.966],10)
  CreateCreature("CM7400S2",[1600.722],0)
  CreateCreature("CM7400S2",[1447.471],12)
  CreateCreature("CM7400S1",[1936.845],4)
  CreateCreature("CM7400S1",[1816.959],2)
  CreateCreature("CM7400S1",[1725.723],8)
END
IF
Dead("cmxx") // xxl
THEN
RESPONSE #100
  SetGlobal("CmEncounterYQuests","GLOBAL",5)
END

Posted Image

"Magically Enhancing the IE Games" since 2001.

Web site
The Undying BG2 mod!
CoM Portraits!

#15 plainab

plainab

    Sasha al'Therin

  • Members
  • 1717 posts
  • Gender:Male
  • Location:Lost on the Sword Coast

Posted 17 April 2012 - 04:26 PM

The script you have there is fine as far as I can tell.

Usually if it is a custom script the CreateCreature actions can come anywhere that you deem necessary so long as everything can take place when it needs to take place.
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users