Author Topic: One more Newbee problem  (Read 2226 times)

Offline gruad

  • Acquaintance
  • *
  • Posts: 0
    • View Profile
One more Newbee problem
« on: October 25, 2006, 04:38:26 AM »

Hello again Ladys and Gentleman,



yesterday(or today in the early morning hours) you helped me to create a sword that glows/shines when it gets weared:



wield sword

As you touch the hilt of the sword it begins to shine brightly.



This is very well!



But everybody else sees this:



his sword begins to glow as they grasp the hilt!



And this isnt very well, what do I need to do to make it look like this:



Suddenly you are blinded for a short moment as Gruad wields his sword.



Maybe you can help me again.  :-$


Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1020
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
One more Newbee problem
« Reply #1 on: October 25, 2006, 05:45:03 AM »
Please post the code you currently have.

Offline gruad

  • Acquaintance
  • *
  • Posts: 0
    • View Profile
One more Newbee problem
« Reply #2 on: October 25, 2006, 05:51:07 AM »

here it is



#include <lib.h>

#include <damage_types.h>

#include <vendor_types.h>



int EquipMessage();



inherit LIB_ITEM;



static void create() {

item::create();

SetKeyName("sword");

SetId( ({ "weapon"}));

SetAdjectives( ({ "generic" }));

SetShort("an old rune-covered sword");

SetLong("You look at an old sword, forged long time ago. Strange runes, written in an unknown language cover the blade.");

SetMass(50);

SetVendorType(VT_WEAPON);

SetClass(30);

SetDamageType(BLADE);

SetWeaponType("blade");

SetRadiantLight(20);

SetWield( (: EquipMessage :) );

}



int EquipMessage() {write("As you touch the hilt of the sword it begins to shine brightly.");

say("Suddenly you are blinded for a short moment as" +this_player()+ "wields the sword.");



return 1;

}



void init(){

::init();

}


Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1020
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
One more Newbee problem
« Reply #3 on: October 25, 2006, 08:03:21 AM »
Try: reload sword

Offline gruad

  • Acquaintance
  • *
  • Posts: 0
    • View Profile
One more Newbee problem
« Reply #4 on: October 25, 2006, 09:54:51 AM »

Hullo again,



won't work with reload sword,



/domains/town/weap/glowing2.c line 26: Invalid argument types to '+' ( string vs object )



maybe I need to check out the name of 'this_player()' to put it into a string variable, and then put it into my sentence like: Suddenly you are blinded as abc(string variable) wields the sword? I saw commands like getname, maybe i can do with this?



sorry Iam a absolute nub ;>


Offline detah

  • BFF
  • ***
  • Posts: 190
  • Ruler of 2D
    • View Profile
One more Newbee problem
« Reply #5 on: October 25, 2006, 11:05:28 AM »

change this_player() to this_player()->GetName()



this_player() is an object.

this_player()->GetName() is a variable. Only variables can exist between + signs.


Offline gruad

  • Acquaintance
  • *
  • Posts: 0
    • View Profile
One more Newbee problem
« Reply #6 on: October 25, 2006, 11:50:33 AM »
Thank you!