BP Logo
Home » MODDING HQ 1.13 » v1.13 Modding, Customising, Editing » v1.13 Modding, Customising, Editing » Need help with StrategicEventHandler.lua
Need help with StrategicEventHandler.lua[message #363450] Fri, 02 July 2021 19:15 Go to next message
No-Nothing

 
Messages:73
Registered:March 2013
Hello! I need help for my struggle with lua!
I want to understand is it possible for non-coder to at least insert any NPC/RPC on any sector at wish with some simplest script.
I hoped Flugente's Max Payne method would be it, but I failed to exploit it for Eskimo (<uiIndex>65</uiIndex>)
I thought this code were enough
Profil = 
{                   
    FATHER = 100,
    HAMOUS = 63,
    PROF_ICECREAM = 162,
ESK = 65,
    RAT   = 81,
	VINCE = 69,
	STEVE = 80,
	JENNY = 132,
	DARREN = 87,
	TONY = 91,
	DEVIN = 61,
	CARMEN = 78,
	SAL = 99,
	PABLO = 98,
	SPIKE = 93,
	ROBOT = 62,
	JOEY = 90,	
	MADLAB = 146,
	CONRAD = 70,
	KINGPIN = 86,
	MADAME = 107,
	JOHN = 118,
	MARY = 119,
}
	-- Set ESK Payne's location
	if  (not ( ( gWorldSectorX == 2) and ( gWorldSectorY == 2) ) and not MercIsDead(Profil.ESK) ) then
	
--		if ( CheckMiscFlags1(Profil.ESK, Flags1.PROFILE_MISC_FLAG_SAID_HOSTILE_QUOTE) == 0 ) then
		
			AddNPCtoSector (Profil.ESK,2,2,0) 
			SetProfileStrategicInsertionData(Profil.ESK, 12089)
			
		end
		
	end
	-- Set ESK Payne's location

But it seems something else needed
May be this number (SetProfileStrategicInsertionData(Profil.ESK, 12089))?
First I thought it be grid#...
https://freeimage.host/i/oo8OUF
https://freeimage.host/i/oo8Nl1
Re: Need help with StrategicEventHandler.lua[message #363451 is a reply to message #363450] Sat, 03 July 2021 01:50 Go to previous messageGo to next message
Kitty

 
Messages:321
Registered:October 2017
Location: Germany
No-Nothing wrote on Fri, 02 July 2021 19:15
Hello! I need help for my struggle with lua!
I want to understand is it possible for non-coder to at least insert any NPC/RPC on any sector at wish with some simplest script.
I hoped Flugente's Max Payne method would be it, but I failed to exploit it for Eskimo (<uiIndex>65</uiIndex>)
I thought this code were enough
Profil = 
{                   
    FATHER = 100,
    HAMOUS = 63,
    PROF_ICECREAM = 162,
ESK = 65,
    RAT   = 81,
	VINCE = 69,
	STEVE = 80,
	JENNY = 132,
	DARREN = 87,
	TONY = 91,
	DEVIN = 61,
	CARMEN = 78,
	SAL = 99,
	PABLO = 98,
	SPIKE = 93,
	ROBOT = 62,
	JOEY = 90,	
	MADLAB = 146,
	CONRAD = 70,
	KINGPIN = 86,
	MADAME = 107,
	JOHN = 118,
	MARY = 119,
}
	-- Set ESK Payne's location
	if  (not ( ( gWorldSectorX == 2) and ( gWorldSectorY == 2) ) and not MercIsDead(Profil.ESK) ) then
	
--		if ( CheckMiscFlags1(Profil.ESK, Flags1.PROFILE_MISC_FLAG_SAID_HOSTILE_QUOTE) == 0 ) then
		
			AddNPCtoSector (Profil.ESK,2,2,0) 
			SetProfileStrategicInsertionData(Profil.ESK, 12089)
			
		end
		
	end
	-- Set ESK Payne's location

But it seems something else needed
May be this number (SetProfileStrategicInsertionData(Profil.ESK, 12089))?
First I thought it be grid#...
https://freeimage.host/i/oo8OUF
https://freeimage.host/i/oo8Nl1

My guess would be, that, if you want to achieve something simular as Flugentes Additional Mercs, you'll have to take other files besides StrateticEventHandler.lua in account as well.

His Additional Mercs GameDir2478 also uses AdditionalDialougue, Quest-markers and other sophisticated stuff. This will probably make it harder to track down parts of the addition.

The version from the link is the most up-to-date I'm aware of, but it's for GameDir 2478. You can't just copy the whole lua-script from 2478 to another GameDir, you'll need to transfer the lines you want from 2478 into newer GameDir, as well as all requirements. For instance, I'm not sure if those flags would work 1on1 with other mercs and/or if those may realted to AdditionalDialougue.

There are a few sub-threads at Flugente's Magika Workshop where Flugente describes what he has done for adding this. There is also more on AdditionalDialogue.

Looking at the screenshots, it seems you want to use it on AIMAS and therefore using bigmaps. The GridNo 12089 is likely refering to standard 1.13-maps. Using this on bigmaps probably will be an odd place for adding. Plus, AIMAS is using another vfs-order (the order in which game looks at folders), this may interfere with additions as well and/or would require the lua-script in another Data-Folder to work.

And, I can't see it very well but do may use some increased Teamsize as well? Or is this an AIMAS feature?

What are you planing to do? Can you explain a little more? Maybe there is another way to solve this.







How to get: latest 1.13, 7609 and more | 7609 SCI (eng) | Compiling+SVN

I need more details. (Didi Hallervorden)
Re: Need help with StrategicEventHandler.lua[message #363452 is a reply to message #363451] Sat, 03 July 2021 13:21 Go to previous messageGo to next message
No-Nothing

 
Messages:73
Registered:March 2013
Thank you for respond! I know AIMNAS files structure very well, believe me (did even heavy GUI mods). If I chose wrong location for StrategicEventHandler.lua I wouldn't get that crash!
I used this value first with the same result. It's value of the location of the above screenshot:
SetProfileStrategicInsertionData(Profil.ESK, 88704)
Unfortunately AIMNAS doesn't have increased Teamsize yet and I did no hacks on this! But yes I go there all-out-power with roster full plus some vehicles.
Kitty wrote on Sat, 03 July 2021 01:50
What are you planing to do? Can you explain a little more? Maybe there is another way to solve this.
I'm not fit for learning lua coding top to toe angry , but it is at least doable in text editor without any compilator or similar crap. So I hope to learn this tiny bit coz it's very usefull not only for RPC but also for any kind of NPC, so you have open gates to many tricks & experiments in various JA2mods.
I don't need it exactly in this file. If there is one simpler variant of coding doing the job by means of other files I'd gladly take it! shy
Thus to the point: the task is to insert any character at any place (ideally but probably not possible at any time - so disregard).

[Updated on: Sat, 03 July 2021 13:27]

Re: Need help with StrategicEventHandler.lua[message #363523 is a reply to message #363452] Tue, 20 July 2021 10:38 Go to previous message
Vritran

 
Messages:189
Registered:February 2020
Location: North East England
Do you actually need to use lua to place an RPC/NPC on the map? Thought placement was MercProfiles.xml and placing the character on the map with map editor.

I've moved Pablo from his Arulco Revisited airport back to the original. Had no issues...

If my understanding is correct the lua stuff would be used to add variables or conditions.
Previous Topic: Custom Mercs
Next Topic: Creating tiles quick and easy
Goto Forum:
  


Current Time: Fri Jul 23 19:56:19 EEST 2021

Total time taken to generate the page: 0.02686 seconds