DMH-Online

Dungeon Masters Helper · Est. 2005

Misc Scripts

NWN Script: mod_intro_002.htm

Author Sticky: Post Working Scripts Here
Morfedel Posted: Wednesday, 26 June 04:30PM
(edited to fit the required format)
(edited a second time to remove an unfortunate comment I left in by mistake)

1. Script Name: Module Entry Messaging by James A Beggs

2. Functionality: Delivers a message to a PC entering the module - and uses their character name in the message.

3. After asking for suggestions from other people, and a lot of experimentation, I got this to work. No one knew exactly the right answer, but each person had a great suggestion that led me on the right path to figuring this out - so thanks to all of you!

This script is intended to be put in the module's OnClientEnter event - but you can put it in a trigger's OnEnter event with some slight modification as well. Playing around with it, you can get all kinds of neat effects.

4. The Script:

NWScript:
void main()
{
    object SendToPC = GetEnteringObject();
    if (GetIsPC(SendToPC))
    {
        string PCNameIs=GetName(SendToPC);
        string WelcomeBegin="Welcome, ";
        string WelcomeEnd=", to Hack-n-Haul, where you can kill things and win fabulous prizes!";
        string BroadcastThis=WelcomeBegin + PCNameIs + WelcomeEnd;
        SendMessageToPC(SendToPC, BroadcastThis);
    }
}



Hope this helps some of you.
 

⌂ All Scripts ← PreviousNext → 👁 Category List

All Misc Scripts

📄 arena 📄 cast_bless_on_PC 📄 change_music 📄 chess_game 📄 climbing 📄 climbing_002 📄 common_includes_002 📄 cone_aoe 📄 cron 📄 cross_country_travel 📄 daoc_style_graves 📄 determine_time 📄 effects 📄 escort 📄 ez_respawn 📄 faction 📄 floating_text 📄 function_includes 📄 gambling 📄 include_sounds 📄 include_time_date 📄 jail 📄 jail_system 📄 journal_entry 📄 logbook 📄 manage_action_queue 📄 mmorpg_vault 📄 mod_intro 📄 mod_intro_002 📄 mod_intro_003 📄 mod_intro_005 📄 pers_world_database 📄 pers_world_database_002 📄 piller_of_fire 📄 plot_item 📄 portal_system 📄 portal_system_002 📄 puking 📄 quest_escort 📄 rep_per 📄 reward_rp 📄 rotation 📄 save_pc_location_002 📄 save_pc_location_003 📄 skill_checks 📄 skill_checks_002 📄 slot_machine 📄 story 📄 swimming 📄 take20_bypass 📄 vis_waypoint 📄 working_temple 📄 working_temple_002 📄 xp_gold_loss 📄 xp_gold_loss_002 📄 xp_loss_action