It is currently Wed Oct 15, 2008 8:23 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Start_Script(script, params)
PostPosted: Sun Jul 02, 2006 8:47 am 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
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...


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 9:07 am 
Offline
Distro Developer
User avatar

Joined: Thu Apr 06, 2006 5:11 pm
Posts: 350
Location: Nederland, Texas
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 9:24 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 9:11 am 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
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 :(


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 9:31 am 
Offline
Distro Developer
User avatar

Joined: Thu Apr 06, 2006 5:11 pm
Posts: 350
Location: Nederland, Texas
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!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 1:44 pm 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 3:17 pm 
Offline
Distro Developer
User avatar

Joined: Thu Apr 06, 2006 5:11 pm
Posts: 350
Location: Nederland, Texas
What are you trying to do? Why do you start the script that way anyway?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 02, 2006 4:51 pm 
Offline

Joined: Mon Feb 06, 2006 6:12 am
Posts: 93
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl