| View previous topic :: View next topic |
| Author |
Message |
penguinflyer5234 Penguin King

Joined: 01 Feb 2008 Age: 15 Posts: 1682 Location: Somewhere
|
Posted: Wed Apr 30, 2008 10:04 pm Post subject: |
|
|
I found in the EgoScript Functions thread:
SetTargetToNearestAlly: SetTargetToNearestFriend
IfTargetIsDead:
| Code: |
IfUsed
SetTargetToNearestFriend
tmpx = targetlife
tmpy = 1 // Minimum life
IfXIsLessThanY
RespawnTarget
IfTargetIsOnSameTeam
HealTarget
|
I don't know if it works. _________________ Donna Noble has left the library. Donna Noble has been saved.
|
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 14 Posts: 3070 Location: Finland
|
Posted: Wed Apr 30, 2008 10:11 pm Post subject: |
|
|
Still script error... It does not make sense...
import/temp0002.obj/script.txt - This undefined
import/temp0002.obj/script.txt - manages undefined
import/temp0002.obj/script.txt - attack undefined
import/temp0002.obj/script.txt - speed undefined
import/temp0002.obj/script.txt - (Adjusted undefined
import/temp0002.obj/script.txt - by undefined
import/temp0002.obj/script.txt - strenght undefined
import/temp0002.obj/script.txt - and undefined
import/temp0002.obj/script.txt - dexterity) undefined _________________
 |
|
| Back to top |
|
 |
penguinflyer5234 Penguin King

Joined: 01 Feb 2008 Age: 15 Posts: 1682 Location: Somewhere
|
Posted: Wed Apr 30, 2008 10:12 pm Post subject: |
|
|
Is the first line a comment? _________________ Donna Noble has left the library. Donna Noble has been saved.
|
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 14 Posts: 3070 Location: Finland
|
Posted: Wed Apr 30, 2008 10:13 pm Post subject: |
|
|
And now it won't kill enemies if there are no friends near... _________________
 |
|
| Back to top |
|
 |
bgbirdsey Developer

Joined: 25 Sep 2007 Posts: 873 Location: Minnesota
|
Posted: Wed Apr 30, 2008 10:51 pm Post subject: |
|
|
Try this
| Code: |
IfUsed
SetTargetToNearestLifeform
IfTargetIsOnHatedTeam
KillTarget
Else
tmpx = targetlife
tmpy = 1 // Minimum life
IfXIsLessThanY
RespawnTarget
HealTarget
|
|
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 14 Posts: 3070 Location: Finland
|
Posted: Thu May 01, 2008 4:32 am Post subject: |
|
|
Now it kills even the friends...
The error...
This file documents typos found in the AI scripts...
import/temp0002.obj/script.txt - This undefined
import/temp0002.obj/script.txt - manages undefined
import/temp0002.obj/script.txt - attack undefined
import/temp0002.obj/script.txt - speed undefined
import/temp0002.obj/script.txt - (Adjusted undefined
import/temp0002.obj/script.txt - by undefined
import/temp0002.obj/script.txt - strenght undefined
import/temp0002.obj/script.txt - and undefined
import/temp0002.obj/script.txt - dexterity) undefined _________________
 |
|
| Back to top |
|
 |
bgbirdsey Developer

Joined: 25 Sep 2007 Posts: 873 Location: Minnesota
|
Posted: Thu May 01, 2008 5:07 am Post subject: |
|
|
You must have missed an opening '/' on a line that reads
"This manages attack speed (Adjusted by strenght and dexterity)"
If you typed my mod in with the correct number of spaces (which is very important), anyone on a different team from you will be killed. You control the teams in the *.mod/basicdat/spawn.txt file.
Unless you have set the team of the scythe in the script to be the same as the person holding it, it will be on whatever team you made it spawn under...
Also, I made a minor error in the script since SetTargetToNearestLifeform only finds living creatures!
| Code: |
IfUsed
tmpargument = [NONE]
tmpdistance = BLAHDEAD + BLAHFRIENDS + BLAHENEMIES
SetTargetToNearestBlahID
IfTargetIsOnHatedTeam
KillTarget
Else
IfTargetIsAlive
HealTarget
Else
RespawnTarget
HealTarget
|
|
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 14 Posts: 3070 Location: Finland
|
Posted: Thu May 01, 2008 5:41 am Post subject: |
|
|
Now there is no script error but enemies won't die if I just attack with it... They should just die, even if it won't hit... Now I have to slash them, and that weapon is not supposed to be like that... _________________
 |
|
| Back to top |
|
 |
bgbirdsey Developer

Joined: 25 Sep 2007 Posts: 873 Location: Minnesota
|
Posted: Thu May 01, 2008 6:02 am Post subject: |
|
|
1) The above code fragment assumes that the SetTargetToNearestBlahID works "as advertised", which it might not be working at all, so the scythe will resurrect everyone??? Assume that this function will be fixed in the future, though!
2) There is some very important information we may need to know before anyone can help you further:
What team are you spawning the scythe as? What team are you? What team is this supposed enemy? What does the alliance.txt file say?
Please don't expect me to go look. It is important for you to learn how this all works... "teach a man to fish" and all of that.
3) Regardless of all of this info, you may HAVE to set the team of the scythe to match the team of the person holding it for this to work the way you want it to. |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 14 Posts: 3070 Location: Finland
|
Posted: Thu May 01, 2008 6:09 am Post subject: |
|
|
IT WORKS NOW!!! I just have to slash and slash like with normal scythe, but it now makes dead friends respawn! And THAT'S the best thing! Thank you, Bgbirdsey! Thank you so much! Yippeeee!  _________________
 |
|
| Back to top |
|
 |
bgbirdsey Developer

Joined: 25 Sep 2007 Posts: 873 Location: Minnesota
|
Posted: Thu May 01, 2008 6:16 am Post subject: |
|
|
You should put something in there about the object requiring all of its own mana to work (just set the mana and manaregen lines in data.txt), so that the rep rate is not way too high.
Also, you could so something with a random number so that it only has a small chance of resurrecting or killing per use? This the chance could increase with the LEVEL OF THE SCYTHE!  |
|
| Back to top |
|
 |
woodmouse Skinner


Joined: 19 Apr 2008 Age: 14 Posts: 3070 Location: Finland
|
Posted: Thu May 01, 2008 6:45 am Post subject: |
|
|
NOW IT WORKS PERFECTLY!!!
I edited the script a little and... Here it is:
//This manages attack speed (Adjusted by strenght and dexterity)
IfUsed
SetTargetToWhoeverIsHolding
tmpargument = targetdex > 9 //Every 2 points of dex increases speed by 1
tmpargument = 60 - tmpargument
SetReloadTime
// ZZ> This function makes an item fall to the floor when spawned
IfSpawned //
tmpargument = ACTIONJB //
DoAction //
KeepAction //
MakeCrushValid
IfCrushed
tmpx = selfx
tmpy = selfy
tmpdistance = selfz
tmpargument = 1
SpawnExactParticle
SpawnExactParticle
SpawnExactParticle
SpawnExactParticle
GoPoof
tmpargument = 1
SendMessageNear
IfDropped // Make it lie on floor
KeepAction //
IfHitGround // Make a sound
tmpargument = 1 //
tmpdistance = rand & 2047 + 10000 //
PlaySound //
IfTakenOut // Make a sound
tmpargument = 2 //
tmpdistance = rand & 2047 + 10000 //
PlaySound //
SetTargetToWhoeverIsHolding //
IfTargetIsAPlayer //
tmpargument = 2 //
SendMessageNear //
IfGrabbed // Tell them what they've won...
SetTargetToWhoeverIsHolding //
IfTargetIsAPlayer //
tmpargument = 0 //
SendMessageNear //
IfUsed
tmpargument = [NONE]
tmpdistance = BLAHDEAD + BLAHFRIENDS + BLAHENEMIES
SetTargetToNearestBlahID
IfTargetIsOnHatedTeam
KillTarget
Else
SetTargetToNearestFriend
IfTargetIsOnSameTeam
IfTargetIsAlive
HealTarget
Else
IfTargetIsOnSameTeam
RespawnTarget
HealTarget
IfUsed
SetTargetToSelf
SendMessageNear // Make a sound
tmpargument = 3 //
End // All done _________________
 |
|
| Back to top |
|
 |
Zefz Lead Designer


Joined: 16 Sep 2007 Posts: 2305 Location: Norway
|
Posted: Thu May 01, 2008 1:04 pm Post subject: |
|
|
I would use SetTargetToNearestEnemy
and IfTargetIsAlive + Else
I find it more optimized and cleaner. _________________ http://egoboo.sourceforge.net
"The pen is mightier than the sword- IF it is sharpened, dipped in poison and thrown really really hard at your target. But seriously, you are better off with a sword." |
|
| Back to top |
|
 |
|