Quantcast

Jump to content

» «
Photo

Sanny Builder Cleo Mod Help

6 replies to this topic
atRM
  • atRM

    If you have nothing nice to say, punch them instead!

  • Members
  • Joined: 28 Dec 2013
  • None

#1

Posted 03 January 2014 - 10:21 AM Edited by atRM, 04 January 2014 - 07:26 AM.

PLEASE HELP HERE. I HAVE NO IDEA WHAT IS WRONG WITH THIS CODE IF YOU KNOW WHAT WRONG COMMENT PLEASE. I am pretty new to Cleo modding by the way :)

 

p.s Don't take this piece of code PLEASE!

 

------ Here it is ------------------------------>

{$CLEO .cs}
:Epic_Mod
03a4: name_thread "mainpt"
0001: wait 1000 ms
0a95: enable_thread_saving

:Vehicle_Spawn
014b: 1@ = init_parked_car_generator #BLADE -1 -1  1 alarm 50 door_lock 0 0 10000 at 2737.2852 -1760.1515 44.1377 angle 100.0
014c: set_parked_car_generator 1@ cars_to_generate_to 101
014b: 2@ = init_parked_car_generator #BF400 -1 -1  1 alarm 50 door_lock 0 0 10000 at 2730.7136 -1760.4995 43.9701 angle 100.0
014c: set_parked_car_generator 2@ cars_to_generate_to 101

:Weapon_Spawn
032b: 3@ create_weapon_pickup #AK47 15 ammo 250 at 2740.6709 -1767.2107 43.9605
032b: 4@ create_weapon_pickup #SNIPER 15 ammo 37 at 2742.2539 -1766.3611 43.959
0213: 5@ create_pickup #BAT 15 at 2743.593 -1765.9052 43.9455
0213: 6@ create_pickup #ARMOUR 15 at 2745.1323 -1764.4515 43.9376

004f: create_thread @Actor_load
:Actor_load
0247: request_model #OMOKUNG
0247: request_model #HFORI
0247: request_model #WMYGOL1

repeat
wait 0
if
0248: model #OMOKUNG available
0248: model #HFORI available
0248: model #WMYGOL1 available
then 
    break
end
until false

009a: 7@ = create_actor_pedtype 20 model #OMOKUNG at 2747.3586 -1754.5149 43.8661
009a: 8@ = create_actor_pedtype 20 model #HFORI at 2748.9807 -1751.6808 43.7915
009a: 9@ = create_actor_pedtype 20 model #WMYGOL1 at 2750.3608 -1753.3768 43.7862
009a: 10@ = create_actor_pedtyoe 20 model #OMOKUNG at 2732.2815 -1752.5846 43.9125
009a: 11@ = create_actor_pedtyoe 20 model #OMOKUNG at 2728.4448 -1751.4138 43.8244
009a: 12@ = create_actor_pedtyoe 20 model #WMYGOL1 at 2727.1189 -1769.4369 43.7951
009a: 13@ = create_actor_pedtyoe 20 model #HFORI at 2729.4907 -1771.5726 43.7951
009a: 14@ = create_actor_pedtyoe 20 model #WMYGOL1 at 2726.373 -1772.9641 43.663

0249: release_model #OMOKUNG
0249: release_model #HFORI
0249: release_model #WMYGOL1

0a93: end_custom_thread
--Help would be GREATLY appreciated--
 
atRM

atRM
  • atRM

    If you have nothing nice to say, punch them instead!

  • Members
  • Joined: 28 Dec 2013
  • None

#2

Posted 04 January 2014 - 07:32 AM Edited by atRM, 04 January 2014 - 07:33 AM.

Sorry If the QUESTION ABOVE from ME is a bit of a stupid question but I am pretty new to CLEO mod making so, if you know the answer I would be so happy!! :) And would give you a HI FIVE! (if that was possible :)

:r*: 


Node
  • Node

    War. War never changes.

  • Members
  • Joined: 31 May 2010
  • United-Kingdom

#3

Posted 04 January 2014 - 12:25 PM Edited by ChopTheDog., 04 January 2014 - 01:01 PM.

//Removed.


Bad.boy!
  • Bad.boy!

    SA modder

  • Feroci
  • Joined: 20 Jun 2010
  • Netherlands

#4

Posted 04 January 2014 - 12:53 PM Edited by Bad.boy!, 04 January 2014 - 12:57 PM.

Your version is incorrect as well ChopTheDog. At the start only wait 1000 ms isn't needed. Knowing the thread name makes it is easier to find the problem if the game should crash. Enable thread saving is very important when creating a car generator because the generator will be written to the save, so everytime you load the game, the generator will be loaded as well. If you don't enable thread saving the car generator will be created X times, resulting in a possible game crash.

03a4: name_thread "mainpt"
0a95: enable_thread_saving

Another thing about car generators is that the model doesn't have to be loaded. This is true for pickups as well. So most of the model load code isn't necessary and should be removed.

 

@atRM

In the original code, you wrote this:

repeat
    wait 0
    if
        0248: model #OMOKUNG available
        0248: model #HFORI available
        0248: model #WMYGOL1 available
    then 
        break
    end
until false

If there are multiple conditions you should write "if and" (or "if or"). I'm sure that the repeat until false structure is wrong as well, but I haven't written anything in SCM for a long time so I won't know the correct way to write it in high level using repeat.

 

 

About the last part of your code, you can't just spawn an actor and forget about it. A character spawned by a script will behave differently than a regular character. A script spawned character will spawn and never disappear until you release it, it also won't do anything until you tell it to do something. You should have also built a check if the player is near, otherwise the character won't be seen anyway.


Node
  • Node

    War. War never changes.

  • Members
  • Joined: 31 May 2010
  • United-Kingdom

#5

Posted 04 January 2014 - 01:00 PM

Thank you for correcting me, I've never worked with car generators so I was oblivious to this.


fastman92
  • fastman92

    фастман92 | ف

  • Members
  • Joined: 28 Jul 2009
  • None
  • Contribution Award [Mods]

#6

Posted 04 January 2014 - 01:08 PM

If there are multiple conditions you should write "if and" (or "if or"). I'm sure that the repeat until false structure is wrong as well, but I haven't written anything in SCM for a long time so I won't know the correct way to write it in high level using repeat.

REPEAT .. UNTIL executes the code as long as the condition isn't TRUE - as long as it's false.

atRM
  • atRM

    If you have nothing nice to say, punch them instead!

  • Members
  • Joined: 28 Dec 2013
  • None

#7

Posted 05 January 2014 - 10:58 AM Edited by atRM, 05 January 2014 - 11:00 AM.

Your version is incorrect as well ChopTheDog. At the start only wait 1000 ms isn't needed. Knowing the thread name makes it is easier to find the problem if the game should crash. Enable thread saving is very important when creating a car generator because the generator will be written to the save, so everytime you load the game, the generator will be loaded as well. If you don't enable thread saving the car generator will be created X times, resulting in a possible game crash.

03a4: name_thread "mainpt"
0a95: enable_thread_saving

Another thing about car generators is that the model doesn't have to be loaded. This is true for pickups as well. So most of the model load code isn't necessary and should be removed.

 

@atRM

In the original code, you wrote this:

repeat
    wait 0
    if
        0248: model #OMOKUNG available
        0248: model #HFORI available
        0248: model #WMYGOL1 available
    then 
        break
    end
until false

If there are multiple conditions you should write "if and" (or "if or"). I'm sure that the repeat until false structure is wrong as well, but I haven't written anything in SCM for a long time so I won't know the correct way to write it in high level using repeat.

 

 

About the last part of your code, you can't just spawn an actor and forget about it. A character spawned by a script will behave differently than a regular character. A script spawned character will spawn and never disappear until you release it, it also won't do anything until you tell it to do something. You should have also built a check if the player is near, otherwise the character won't be seen anyway.

 

Thank you very much Bad.boy! I will change the script to what I have read from you and others then post it again! If you want you can check it after I have re-post the edited script :^: :^:





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users