PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Start_Script(script, params)

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095)
Display posts from previous:   

Author Message
DevGIB



Joined: 06 Feb 2006
Posts: 93

PostPosted: Sun Jul 02, 2006 12:47 pm    Post subject: Start_Script(script, params) Reply with quote

Ok i have a new problem to do with start script... well its not a problem i just dotn think its working how the scripter meant it to work... if someone could help me this would be greatly appreciated.

start_script line:
Code:
start_script (":combat:"+hitscript, {attacker, defender, attacker.weapon, def_armor, wbasedamage, 0});


wil this work properly
Code:
program mainhit(attacker, defender, weapon, armor, basedamage, rawdamage)


it seems as tho passing everything in an array it doesnt come through properly...

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Sun Jul 02, 2006 1:07 pm    Post subject: Reply with quote

You have to grab all of the params from the array like this:

Code:
Start_Script(":combat:"+hitscript, array{attacker, defender, vbasedamage, 0})


Code:
program mainHit(params)
   var attacker := params[1];
   var defender := params[2];
   var base_damage := params[3];
   var raw_damage := params[4];

   // Combat hooks are complicated, good luck!
   // Make sure it's as optimized as possible
   // You _could_ just use the combat hook in the distro...


One should not have to pass attacker.weapon or def_armor if one already has access to the attacker and defender mobile refrences, but if you do, just put them in.


Last edited by tekproxy on Sun Jul 02, 2006 1:24 pm; edited 1 time in total

Author Message
DevGIB



Joined: 06 Feb 2006
Posts: 93

PostPosted: Sun Jul 02, 2006 1:11 pm    Post subject: Reply with quote

only problem is with that i now have to go and change every single hitscript to support that method, and the reason why we have to pass the weapons and armour and staff is because its appart of our attack hook and some files need it to retrieve props from the weapons and armour Sad

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Sun Jul 02, 2006 1:31 pm    Post subject: Reply with quote

You do not need to pass attacker.weapon to the hit script if you are already passing the mobile refrence attacker. If you want to access attacker's weapon then do so with attacker.weapon in the hit script. If you ever use something other than attacker.weapon for the attacker's weapon then you would need to send the weapon but I don't think that's a good idea. It's your call. That's just how you use Start_Script(). Good luck!

Author Message
DevGIB



Joined: 06 Feb 2006
Posts: 93

PostPosted: Sun Jul 02, 2006 5:44 pm    Post subject: Reply with quote

Thanks to Wywern from the IRC who provided this fix ill post it so if anyone else has questions about it they can check this out... (keeping support active)
Code:
program mainhit(attacker, defender, weapon, armor, basedamage, rawdamage)

If(TypeOf(attacker) == "Array")
defender := attacker[2];
weapon := attacker[3];
armor := attacker[4];
basedamage := attacker[5];
rawdamage := attacker[6];
attacker:= attacker[1]; //Must Be Last To Keep Attacker relative to the hook for other parms above
endif

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Sun Jul 02, 2006 7:17 pm    Post subject: Reply with quote

What are you trying to do? Why do you start the script that way anyway?

Author Message
DevGIB



Joined: 06 Feb 2006
Posts: 93

PostPosted: Sun Jul 02, 2006 8:51 pm    Post subject: Reply with quote

its a hitscript... we have an attack hook and in the attack hook the end of it, it calls the hitscript
how ever start_script() only allows you to send 1 parm not multiple

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095) All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty