• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Coding help!

Estharos

Landlubber
Storm Modder
Hi, guys. I'm trying to make an none playing character(NPC) to walk or run to the Playing character (Pch)and start a dialog, when the Pch enter an area let say Bridgtown_town. How I should put the coding for that?

Cheers, :cheers
 
If it is the same as in PotC (which I have a feeling it might be)

EDIT: looked at CoAS and it is similiar however slightly different :yes

Code:
			npc.dialog.currentnode = "*CASE*";
LAi_SetActorType(npc);
LAi_ActorDialogNow(npc, pchar, "*go to case*", -1);
 
In COAS the coding is differente but it help me to figure it out, thanks for that :doff .

However I'm stuck. I'm trying to make another character to start else where then the Estate or the ship, and it ain't working. I manage to make the character start in Bridgetown tavern, but all Peter Blood dialog are still there and I'm screwed since if I try to bypass those dialog the game don't even start. And trying to start a new character elsewhere then Bridgetown ain't working either.

While playing with that I notice that the game regardless where you make the character start in bridgetown, always start Peter Blood storyline codes. Example; I take Nathaniel as a dummy. Peter start in the Estate and the storyline is perfect, no problem there. The rest of the characters except Nathaniel start on the boat, no problem with the storyline same as Peter. Now for Nathaniel, he start in the tavern talk to a guy at the start so you can set your stats then the guy leave the tavern by walking out, work fine so far, but if I talk to the barmen to rent a room, he think I'm Peter Blood and don't want to rent me a room, same think for the others, Storeman, Shipyard so in fact everyone thinks I'm Peter except the Storyline ain't there.

So I came to the conclusion that, the storyline are maybe coded into the engine it self. So I decide a differente approche. By letting Nathaniel start on the boat like the others, then tell the pitrate guy that if it's Nathaniel to send him into the tavern. And it work, with a minor problem. When he send me to the tavern, 2 sec later a Lord appear(someone I created) in the tavern and talk to me so I can set my stats, after the dialog my character is stuck and can't move at all. Maybe it's a coding error.

However I remove the Lord so I can interact with the people in town and it work well, people don't think I'm Peter anymore. Now my problem is that Lord that avoid me to move again once I finish talking to him.

Anyone can help me with that?

Cheers, :cheers
 
I'm sure you're going to have to edit all the files involved in the Blood quest, this includes all the dialogs and reactions of all the NPC's. Copy the files, rename them with your own quest name and then start rewriting the whole thing. :shrug

If you're not using it already, the DialogMerge is a very helpful tool, you can find it here at PA in the downloads section.
 
If I could manage to fix this error that I can't move after a dialog I will have bypass all this, so no need to do all that work. But I'm stuck. :shrug

Cheers, :cheers
 
I want to set the time to 10pm, when the player as been teleport to an area. How can I do that?

Cheers, :cheers
 
Code:
SetCurrentTime(10.00, 0);

That code does it for the Build Mod, not sure if it is the same

Thanks, Cap. It work, except you need to put (22.00,0)

I'm trying to give a ship to the playing character, after doing a quest. The playing character got no ship yet. Anyone knows how?

Cheers, :cheers
 
Thanks Mate,

Now I would like to disable the, quick walking around you know when you are in town and you hit enter to teleport you where you want, how can I disable this.

Cheers, :cheers
 
Well with your help Captain Maggee, I manage to finish part one of my Storyline. Now I'm gonna start part two, and require your help again, or anyone. I want to do 3 things and try to do them but no succes.

1- I want to spawn an hostile ship that attack you as soon you enter the sea from Dominica Island(pretty much the same as when you steal the Spanish frigate at the end of Blood, you get attack by 2 ships when you enter the sea.)

2- I want 2 NPC character to fight each other, after a dialog.(so when I finish talking to someone I want billy and Ted to fight each other.

3- how you make a character to disapear, 5 sec after a dialog, without making him change location?

I got a lot more to come but if those are ansered, I will be able to made a good portion of part two.

Cheers, :cheers
 
Well with your help Captain Maggee, I manage to finish part one of my Storyline. Now I'm gonna start part two, and require your help again, or anyone. I want to do 3 things and try to do them but no succes.

1- I want to spawn an hostile ship that attack you as soon you enter the sea from Dominica Island(pretty much the same as when you steal the Spanish frigate at the end of Blood, you get attack by 2 ships when you enter the sea.)

2- I want 2 NPC character to fight each other, after a dialog.(so when I finish talking to someone I want billy and Ted to fight each other.

3- how you make a character to disapear, 5 sec after a dialog, without making him change location?

I got a lot more to come but if those are ansered, I will be able to made a good portion of part two.

Cheers, :cheers

I manage to figure out question #1 and 3, but still need to know how to make 2 NPC's character to fight each other, anyone can help?



Cheers, :cheers
 
Hi Estharos, you can try it:

sld = characterFromId("Billy");
LAi_SetWarriorType(sld);
LAi_group_MoveCharacter(sld, "EnemyFight");
sld = characterFromId("Ted");
LAi_SetWarriorType(sld);
LAi_group_MoveCharacter(sld, "EnemyFight");
LAi_group_SetRelation("EnemyFight", LAI_GROUP_ENEMY, LAI_GROUP_ENEMY);
LAi_group_FightGroups("EnemyFight", LAI_GROUP_ENEMY, true);

I'm not sure but I think it should work.

Regards
 
Hi Estharos, you can try it:

sld = characterFromId("Billy");
LAi_SetWarriorType(sld);
LAi_group_MoveCharacter(sld, "EnemyFight");
sld = characterFromId("Ted");
LAi_SetWarriorType(sld);
LAi_group_MoveCharacter(sld, "EnemyFight");
LAi_group_SetRelation("EnemyFight", LAI_GROUP_ENEMY, LAI_GROUP_ENEMY);
LAi_group_FightGroups("EnemyFight", LAI_GROUP_ENEMY, true);

I'm not sure but I think it should work.

Regards
Thanks gonna try it once I got a chance.


Cheers, :cheers
 
Back
Top