Quantcast

Jump to content

» «
Photo

load_special_actor with array?

  • This topic is locked This topic is locked
7 replies to this topic
ceejay92
  • ceejay92

    Player Hater

  • Members
  • Joined: 31 Jan 2014

#1

Posted 31 January 2014 - 04:08 PM

 The following works:

05AA: [email protected] = 'CAT'
023C: load_special_actor [email protected] as 1 // models 290-299

but this one in array do not:

05AA: [email protected] = 'TRUTH'
05AA: [email protected] = 'WUZIMU'
05AA: [email protected] = 'ZERO'
for 0@ = 2 to 4
  023C: load_special_actor 2@(0@,3s) as 0@
  while 823D: not special_actor 0@ loaded
    wait 0
  end
end

Why?


Silent
  • Silent

    Altering R* Vision™ since 2008

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#2

Posted 31 January 2014 - 04:21 PM

Short strings occupy 2 local vars each, so you should put these entries in [email protected], [email protected] and [email protected] respectively.

ceejay92
  • ceejay92

    Player Hater

  • Members
  • Joined: 31 Jan 2014

#3

Posted 31 January 2014 - 04:28 PM

Thanks

 

So the first [email protected] already occupy [email protected] ?


Silent
  • Silent

    Altering R* Vision™ since 2008

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#4

Posted 31 January 2014 - 04:30 PM

[email protected] occupies 1@ and 2@, [email protected] occupies 2@ and 3@.... and so on.
The same for long strings ([email protected]), but they occupy 4 continuous locals.

ceejay92
  • ceejay92

    Player Hater

  • Members
  • Joined: 31 Jan 2014

#5

Posted 31 January 2014 - 04:35 PM

okay thanks a lot


ceejay92
  • ceejay92

    Player Hater

  • Members
  • Joined: 31 Jan 2014

#6

Posted 31 January 2014 - 05:26 PM Edited by ceejay92, 31 January 2014 - 05:27 PM.

I just test it



05AA: [email protected] = 'TRUTH'
05AA: [email protected] = 'WUZIMU'
05AA: [email protected] = 'ZERO'
for 0@ = 1 to 3
023C: load_special_actor 1@(0@,3s) as 0@
while 823D: not special_actor 0@ loaded
wait 0
end
end

why it still crashed?

How do I call the index if each occupy 2 local vars?



05AA: [email protected] = 'TRUTH'
05AA: [email protected] = 'WUZIMU'
05AA: [email protected] = 'ZERO'

0006: 25@ = 1
for 0@ = 1 to 3
023C: load_special_actor 1@(25@,3s) as 0@
while 823D: not special_actor 0@ loaded
wait 0
end
0008: 25@ += 2
end

Above also crashed

 

I think I still don't understand


Silent
  • Silent

    Altering R* Vision™ since 2008

  • GTA Mods Staff
  • Joined: 01 Feb 2010
  • Poland
  • Contribution Award [Mods]
    Best Script/Plugin 2014 [SilentPatch]
    Most Respected 2014
    Most Helpful [Mods] 2014
    Most Helpful [GTA] 2013
    Most Helpful [Mods] 2013
    Most Talented [Modding] 2013
    Best Map 2013 [ViceCityStories PC Edition]
    Best Vehicle 2013 [III Aircraft]
    Most Helpful [Mods] 2012
    Modder of the Year 2012

#7

Posted 31 January 2014 - 05:46 PM

The game handles indexes properly if you specify the type of array to be s, just like you did. The only mistake your 1st script has is array indexes - they should be zero-based (so you need 0 to 2).

ceejay92
  • ceejay92

    Player Hater

  • Members
  • Joined: 31 Jan 2014

#8

Posted 31 January 2014 - 05:54 PM

oh i see, I didn't realize if index has to start with 0

thanks it works now





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users