Script related questions

Help regarding development/scripting, troubleshooting or just general gameplay -- anything that hasn't already been answered in the Wiki or pinned FAQs.

Moderator: Developers

User avatar
penguinflyer2222
Queen Penguin (Senior Member)
Queen Penguin (Senior Member)
Posts: 6614
Joined: Wed Jul 23, 2008 1:51 am

Post by penguinflyer2222 »

I think 256 or something like that is equal to one life point.
Check some scripts that handle that stuff.
......
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Yes all stat values are equal to *256

That means 1024 life is 4 life points.

You can also write tmpargument = 4 < 8
which also equals 1024 or 4 life points. Same as 9 < 8 becomes 9 life points. (The < indicates a bitewise shift)
Last edited by Zefz on Sat Nov 01, 2008 11:11 am, edited 1 time in total.
Cimeries
Lumberjack (Developer)
Lumberjack (Developer)
Posts: 7720
Joined: Wed Jul 23, 2008 6:56 am

Post by Cimeries »

Zefz wrote:Same as 9 > 8 becomes 9 life points. (The > indicates a bitewise shift)


Oh, now *I* get it. :P
:wink:
User avatar
Ben Urban
Cobol (Esteemed member)
Cobol (Esteemed member)
Posts: 829
Joined: Sat Oct 04, 2008 10:49 pm
Location: Maryland, USA
Contact:

Post by Ben Urban »

That shift appears to be in the wrong direction...
Thanks to penguinflyer2222 for the avatar, and to penguinflyer5234 for hosting it.
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

Oh right! My bad. I shifted the bits the wrong direction :P Making it 1/256 hp instead of *256 hp xD Fixed it now.
User avatar
Agent of Dread
Protector (Senior Member)
Protector (Senior Member)
Posts: 8991
Joined: Wed Jul 23, 2008 8:46 pm
Location: Australia
Contact:

Post by Agent of Dread »

I suppose this has to do with some form of game scripting, so...
Can any module support more than 4 tileset images?
- Linktree: linktr.ee/trilbs -
Cimeries
Lumberjack (Developer)
Lumberjack (Developer)
Posts: 7720
Joined: Wed Jul 23, 2008 6:56 am

Post by Cimeries »

Agent of Dread wrote:I suppose this has to do with some form of game scripting, so...
Can any module support more than 4 tileset images?

No.
And even if it did, Egomap would still be unable to read the additional ones, so you have no means of using them.
:wink:
User avatar
Agent of Dread
Protector (Senior Member)
Protector (Senior Member)
Posts: 8991
Joined: Wed Jul 23, 2008 8:46 pm
Location: Australia
Contact:

Post by Agent of Dread »

Ok, thanks. :)
- Linktree: linktr.ee/trilbs -
Cimeries
Lumberjack (Developer)
Lumberjack (Developer)
Posts: 7720
Joined: Wed Jul 23, 2008 6:56 am

Post by Cimeries »

The script function "IfTargetIsOwner" does not work.
I suggest it be fixed or removed from the Ego functions list. Perferably the former, because I need it...
:wink:
User avatar
penguinflyer5234
Sheep (Developer)
Sheep (Developer)
Posts: 3025
Joined: Wed Jul 23, 2008 1:39 am
Location: Best Southwest

Post by penguinflyer5234 »

IfTargetIsOwner is in the 2.7.x trunk
...
Cimeries
Lumberjack (Developer)
Lumberjack (Developer)
Posts: 7720
Joined: Wed Jul 23, 2008 6:56 am

Post by Cimeries »

penguinflyer5234 wrote:IfTargetIsOwner is in the 2.7.x trunk

When did we move to that trunk?
:wink:
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Post by Zefz »

He means that I've added it into the 2.7.x (trunk) version and havent added it to our 2.6.x version yet.
User avatar
ShellShocker
Rust Eater (Senior Member)
Rust Eater (Senior Member)
Posts: 3625
Joined: Thu Jul 24, 2008 6:37 am
Location: Australia

Post by ShellShocker »

Zefz wrote:He means that I've added it into the 2.7.x (trunk) version and havent added it to our 2.6.x version yet.

Wait.. what!?!?!??!
I thought you left!
EDIT: You posted you came back the very same minute I posted this.... T_T
Image
This signature picture has been cropped to fit the size limit.
Cimeries
Lumberjack (Developer)
Lumberjack (Developer)
Posts: 7720
Joined: Wed Jul 23, 2008 6:56 am

Post by Cimeries »

Should I download the new trunk then, is it playable?
Can you add the function to the 2.6.x trunk, if not?
(I'm very obsessed at making sure my stuff is working right, if I don't see for myself, I don't regard it as such, it's been keeping me back for the past couple of days... Well, that, and Geneforge 4 :P)

Also, I'm sending you a PM soon.
:wink:
User avatar
Ryrgwryr
Grub Bug (Rookie)
Grub Bug (Rookie)
Posts: 42
Joined: Sun Dec 14, 2008 12:49 pm
Location: I'm here right now.

Post by Ryrgwryr »

Umm, I have few questions:
1. Is there a function to change size without enchanting?
Because battleaxe is naturally 1.7 size and it's not compatibile with ChangeTargetClass I think, and I really don't want lvled battleaxe. :P
2. Is it possible to change holder's content using weapon script?
Like this:

Code: Select all

    IfStateIs13
      SetTargetToWhoeverIsHolding
      tmpargument = 160
      SetContent

Because it doesn't seem to work for me. Basically I have a random cobol weapon object, I wanted to improve it, whips for example have higher range and cobols use content to determine when to attack target.
I'm using 2.74v.

Entire randomising script looks like that if sth.:

Code: Select all

  //Randomize weapon
IfHeldInLeftHand
  tmpargument = rand % 3
  SetState
  IfStateIs0
    tmpargument = 78
  IfStateIs1
    tmpargument = 78
  IfStateIs2
    tmpargument = 78
  IfStateIs3
    tmpargument = 56
  ChangeTargetClass         //Change it to whatever tmpargument was set!
Else
  tmpargument = 0            //Melee weapon
  IfContentIs
    tmpargument = rand % 15
    SetState
    IfStateIs0     
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
      tmpargument = 56
    IfStateIs1
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
      tmpargument = 56
    IfStateIs2
      tmpargument = 56
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
    IfStateIs3
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
      tmpargument = 56
    IfStateIs4
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
      tmpargument = 56
    IfStateIs5
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
      tmpargument = 56
    IfStateIs6
      SetTargetToWhoeverIsHolding
      tmpargument = 140
      SetContent
      SetTargetToSelf
      tmpargument = 77
    IfStateIs7
      SetTargetToWhoeverIsHolding
      tmpargument = 140
      SetContent
      SetTargetToSelf
      tmpargument = 77
    IfStateIs8
      SetTargetToWhoeverIsHolding
      tmpargument = 140
      SetContent
      SetTargetToSelf
      tmpargument = 77
    IfStateIs9
      SetTargetToWhoeverIsHolding
      tmpargument = 140
      SetContent
      SetTargetToSelf
      tmpargument = 77 
    IfStateIs10
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
      tmpargument = 74
    IfStateIs11
      SetTargetToWhoeverIsHolding
      tmpargument = 120
      SetContent
      SetTargetToSelf
      tmpargument = 74
    IfStateIs12
      SetTargetToWhoeverIsHolding
      tmpargument = 160
      SetContent
      SetTargetToSelf
      tmpargument = 208
    IfStateIs13
      SetTargetToWhoeverIsHolding
      tmpargument = 160
      SetContent
      SetTargetToSelf
      tmpargument = 208
    IfStateIs14
      SetTargetToWhoeverIsHolding
      tmpargument = 160
      SetContent
      SetTargetToSelf
      tmpargument = 207
    IfStateIs15
      SetTargetToWhoeverIsHolding
      tmpargument = 160
      SetContent
      SetTargetToSelf
      tmpargument = 207       //Warning: This weapon isn't in global objects(whip and battleaxe).
    ChangeTargetClass         //Change it to whatever tmpargument was set!
  tmpargument = 1            //Ranged weapon
  IfContentIs
    tmpargument = rand % 3
    SetState
    IfStateIs0
      tmpargument = 61
    IfStateIs1
      tmpargument = 71
    IfStateIs2
      tmpargument = 61
    IfStateIs3
      tmpargument = 71
    MakeAmmoKnown
    ChangeTargetClass         //Change it to whatever tmpargument was set!
Studying...
Post Reply