Quantcast

Jump to content

» «
Photo

External Script

4 replies to this topic
Revolution-Designes
  • Revolution-Designes

    AKA JopperX9

  • Members
  • Joined: 28 Dec 2008
  • None
  • Best Mission 2012 [Left 4 Theft San Andreas]

#1

Posted 06 April 2012 - 09:33 PM

So I've picked up coding again and tried to make my own external script in the stripped main.scm

I defined it:
CODE
DEFINE EXTERNAL_SCRIPTS 1 // Use -1 in order not to compile AAA script
DEFINE SCRIPT WEATHERCONTROL AT @WEATHERCONTROL // 0


And added the script:
CODE
:WEATHERCONTROL
thread 'WEATHERCONTROL'

:WEATHERCONTROL1
set_weather 9
01B5: force_weather 1
end_thread
jump @WEATHERCONTROL1


I also loaded the script and made it run:
CODE
08A9: load_external_script 0 (WEATHERCONTROL)
0913: run_external_script 0 (WEATHERCONTROL)  


It's supposed to simply keep the weather at foggy, number 9. But as I don't know how this thread and script combination actually works I need some help. As soon as I start a new game and change the weather with a cheat it doesn't turn to foggy again. So the problem is that it doesn't loop. Anyone knows how this works?

xrk
  • xrk

    ..

  • Members
  • Joined: 04 Feb 2004

#2

Posted 06 April 2012 - 10:14 PM

QUOTE (Revolution-Designes @ Friday, Apr 6 2012, 21:33)
CODE

:WEATHERCONTROL1
set_weather 9
01B5: force_weather 1
end_thread
jump @WEATHERCONTROL1



Isnt the jump after you end the thread useless?

Revolution-Designes
  • Revolution-Designes

    AKA JopperX9

  • Members
  • Joined: 28 Dec 2008
  • None
  • Best Mission 2012 [Left 4 Theft San Andreas]

#3

Posted 07 April 2012 - 08:35 AM

QUOTE (xrk @ Saturday, Apr 7 2012, 00:14)
QUOTE (Revolution-Designes @ Friday, Apr 6 2012, 21:33)
CODE

:WEATHERCONTROL1
set_weather 9
01B5: force_weather 1
end_thread
jump @WEATHERCONTROL1



Isnt the jump after you end the thread useless?

Yeah, I guess you're right. But that doesn't solve my problem.

xrk
  • xrk

    ..

  • Members
  • Joined: 04 Feb 2004

#4

Posted 07 April 2012 - 10:29 AM Edited by xrk, 07 April 2012 - 10:34 AM.

I didnt say it would. I dont know much about coding.
in anycase, you say you want it to loop, where is the loop? why end thread?
Like I say I really dont know much about coding but isnt this more the idea?

CODE

:WEATHERCONTROL1
wait 10
set_weather 9
01B5: force_weather 1
jump @WEATHERCONTROL1



All yours looks like it does, is sets and forces weather then finishes.

Revolution-Designes
  • Revolution-Designes

    AKA JopperX9

  • Members
  • Joined: 28 Dec 2008
  • None
  • Best Mission 2012 [Left 4 Theft San Andreas]

#5

Posted 07 April 2012 - 10:47 AM

QUOTE (xrk @ Saturday, Apr 7 2012, 12:29)
I didnt say it would. I dont know much about coding.
in anycase, you say you want it to loop, where is the loop? why end thread?
Like I say I really dont know much about coding but isnt this more the idea?

CODE

:WEATHERCONTROL1
wait 10
set_weather 9
01B5: force_weather 1
jump @WEATHERCONTROL1



All yours looks like it does, is sets and forces weather then finishes.

Removing the end_thread and let it loop doesn't work. It simply doesn't change to foggy weather when I use a cheat to change the weather. But when I create them as threads, so no external script, it works just fine.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users